Improve help message

This commit is contained in:
Joscha 2018-03-18 19:46:11 +00:00
parent bf5bfd1441
commit 7dd2a0bdad

View file

@ -12,15 +12,22 @@ import qualified Options.Applicative as O
import qualified TaskMachine.UI as TM import qualified TaskMachine.UI as TM
data Options = Options data Options = Options
{ oExportDefaultTheme :: [String] { oThemePaths :: [FilePath]
, oThemePaths :: [FilePath] , oExportDefaultTheme :: [String]
} deriving (Show) } deriving (Show)
argParser :: O.Parser Options argParser :: O.Parser Options
argParser = pure Options argParser = pure Options
<*> many exportDefaultTheme
<*> many themePaths <*> many themePaths
<*> many exportDefaultTheme
where where
themePaths = O.strOption $ mconcat
[ O.short 't'
, O.long "theme"
, O.help "Specify one or more theme files to load.\
\ This flag can be set zero or more times."
, O.metavar "THEMEFILE"
]
exportDefaultTheme = O.strOption $ mconcat exportDefaultTheme = O.strOption $ mconcat
[ O.short 'T' [ O.short 'T'
, O.long "export-default-theme" , O.long "export-default-theme"
@ -28,13 +35,6 @@ argParser = pure Options
\ This can be used as a starting point for a custom theme." \ This can be used as a starting point for a custom theme."
, O.metavar "THEMEFILE" , O.metavar "THEMEFILE"
] ]
themePaths = O.strOption $ mconcat
[ O.short 't'
, O.long "theme"
, O.help "Specify one or more theme files to load.\
\ This flag can be set zero or more times."
, O.metavar "THEME"
]
argParserInfo :: O.ParserInfo Options argParserInfo :: O.ParserInfo Options
argParserInfo = O.info (O.helper <*> argParser) mempty argParserInfo = O.info (O.helper <*> argParser) mempty