Update help docs

This commit is contained in:
Joshua Clayton 2016-05-11 09:22:29 -04:00
parent cf542044df
commit 9407b91b3b

View File

@ -17,7 +17,14 @@ data Options = Options
main :: IO () main :: IO ()
main = withInterruptHandler $ main = withInterruptHandler $
run =<< execParser run =<< execParser
(parseOptions `withInfo` "Analyze potentially unused code") (withInfo parseOptions pHeader pDescription pFooter)
where
pHeader = "Unused: Analyze potentially unused code"
pDescription = "Unused allows a developer to pipe in a list of tokens to\
\ search through in directory to determine likelihood a\
\ token can be removed. Requires tokens be piped into the\
\ program seperated by newlines. See CLI USAGE below."
pFooter = "CLI USAGE: $ cat path/to/ctags | cut -f1 | sort -u | unused"
run :: Options -> IO () run :: Options -> IO ()
run options = do run options = do
@ -34,8 +41,9 @@ run options = do
return () return ()
withInfo :: Parser a -> String -> ParserInfo a withInfo :: Parser a -> String -> String -> String -> ParserInfo a
withInfo opts desc = info (helper <*> opts) $ progDesc desc withInfo opts h d f =
info (helper <*> opts) $ header h <> progDesc d <> footer f
optionFilters :: Options -> (ParseResponse -> ParseResponse) optionFilters :: Options -> (ParseResponse -> ParseResponse)
optionFilters o = optionFilters o =
@ -82,7 +90,7 @@ parseLikelihoodOption :: Parser String
parseLikelihoodOption = strOption $ parseLikelihoodOption = strOption $
short 'l' short 'l'
<> long "likelihood" <> long "likelihood"
<> help "[Allows multiple] [Allowed values: high, medium, low] Display results based on likelihood" <> help "[Allows multiple] [Allowed: high, medium, low] Display results based on likelihood"
parseIgnorePaths :: Parser [String] parseIgnorePaths :: Parser [String]
parseIgnorePaths = many $ strOption $ parseIgnorePaths = many $ strOption $