~yoctocell/flaskell

3014ff494d599a8b70facf7103cded83c90cd15b — Xinglu Chen 1 year, 5 months ago 0013743
Cli: Remove unused parts
1 files changed, 0 insertions(+), 6 deletions(-)

M src/Flaskell/Cli.hs
M src/Flaskell/Cli.hs => src/Flaskell/Cli.hs +0 -6
@@ 7,7 7,6 @@ import           Flaskell.Parser
import           Flaskell.Ui

import           Options.Applicative
-- import qualified Data.ByteString               as B
import           Data.Text                      ( Text )
import qualified Data.Text.IO                  as T
import           System.Environment             ( getArgs


@@ 41,7 40,6 @@ cliArgs =
  Options
    <$> switch (long "version" <> short 'v' <> help "Print the version number")
    <*> fileInput
          -- <*> (fileInput <|> stdInput)

-- | Parse CLI arguments
parseCliArgs :: Options -> IO ()


@@ 51,13 49,9 @@ parseCliArgs options = case options of
    contents <- T.readFile file
    let result = getCards contents
    if null result then handleError else feedCards result
    -- FIXME hGetLine closed handle error
  (Options False StdInput) -> do
    contents <- getArgs
    putStrLn $ last contents
    -- contents <- getContents
    -- length contents `seq` return ()
    -- feedCards . getCards $ contents

-- | Take contents of a file and return a list of Flashcard
getCards :: Text -> [Flashcard]