From e66d94505776ec13259bedde4e5342985322a482 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 8 May 2016 02:09:04 +0200 Subject: Feature completion --- src/Command.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/Command.hs') diff --git a/src/Command.hs b/src/Command.hs index 659d14d..127e986 100644 --- a/src/Command.hs +++ b/src/Command.hs @@ -19,6 +19,9 @@ import qualified Data.Text as Text import Data.Maybe (fromMaybe) +import Data.CaseInsensitive ( CI ) +import qualified Data.CaseInsensitive as CI + import Types data Cmd = PerformAlt Alteration Comment @@ -85,7 +88,7 @@ parseCmd' args = do cmdParser :: Maybe Entity -> Parser Cmd cmdParser tip = hsubparser $ mconcat [ command "quit" $ pure Quit `info` progDesc "Exit gracefully" - , command "dump" $ pure Dump `info` progDesc "Print all internal state in a format not necessarily human readable" + , command "list" $ pure Dump `info` progDesc "Print a list of tracked entities" , command "history" $ parseHistory `info` progDesc "Print an excerpt of combat history" , command "who" $ pure ShowTip `info` progDesc "Who’s turn is it?" , command "set" $ parseOverride `info` progDesc "Set an entities sequence value" @@ -116,7 +119,7 @@ cmdParser tip = hsubparser $ mconcat [ command "quit" $ pure Quit `info` progDes entity | (Just tip') <- tip = fromMaybe tip' <$> optional entity' | otherwise = entity' - entity' = Entity <$> (Text.pack <$> strArgument (help "Name of the target entity" <> metavar "NAME")) <*> optional (argument positive $ help "Number of the target entity" <> metavar "NUMBER") + entity' = Entity <$> (CI.mk . Text.pack <$> strArgument (help "Name of the target entity" <> metavar "NAME")) <*> optional (option positive $ long "number" <> short 'n' <> help "Number of the target entity" <> metavar "NUMBER") sequenceValue = argument auto (help "Sequence value adjustment" <> metavar "SEQUENCE") sequenceValue' = argument auto (help "Sequence value" <> metavar "SEQUENCE") -- cgit v1.2.3