Update commandline help output

pull/75/head
Lennart Spitzner 2017-10-04 23:43:30 +02:00
parent 45d5235724
commit 7d7ec3e8b4
1 changed files with 20 additions and 6 deletions

View File

@ -62,12 +62,23 @@ helpDoc :: PP.Doc
helpDoc = PP.vcat $ List.intersperse helpDoc = PP.vcat $ List.intersperse
(PP.text "") (PP.text "")
[ parDocW [ parDocW
[ "Transforms one haskell module by reformatting" [ "Reformats one or more haskell modules."
, "(parts of) the source code (while preserving the" , "Currently affects only type signatures and function bindings;"
, "parts not transformed)." , "everything else is left unmodified."
, "Based on ghc-exactprint, thus (theoretically) supporting all" , "Based on ghc-exactprint, thus (theoretically) supporting all"
, "that ghc does." , "that ghc does."
, "Currently, only type-signatures and function-bindings are transformed." ]
, parDoc $ "Example invocations:"
, PP.hang (PP.text "") 2 $ PP.vcat
[ PP.text "brittany"
, PP.hang (PP.text " ") 2 $ PP.text "read from stdin, output to stdout"
]
, PP.hang (PP.text "") 2 $ PP.vcat
[ PP.text "brittany --indent=4 --write-mode=inplace *.hs"
, PP.nest 2 $ PP.vcat
[ PP.text "run on all modules in current directory (no backup!)"
, PP.text "4 spaces indentation"
]
] ]
, parDocW , parDocW
[ "This program is written carefully and contains safeguards to ensure" [ "This program is written carefully and contains safeguards to ensure"
@ -128,9 +139,12 @@ mainCmdParser helpDesc = do
writeMode <- addFlagReadParam writeMode <- addFlagReadParam
"" ""
["write-mode"] ["write-mode"]
"" "(display|inplace)"
Flag Flag
{ _flag_help = Just (PP.text "output mode: [display|inplace]") { _flag_help = Just $ PP.vcat
[ PP.text "display: output for any input(s) goes to stdout"
, PP.text "inplace: override respective input file (without backup!)"
]
, _flag_default = Just Display , _flag_default = Just Display
} }
inputParams <- addParamNoFlagStrings "PATH" (paramHelpStr "paths to input haskell source files") inputParams <- addParamNoFlagStrings "PATH" (paramHelpStr "paths to input haskell source files")