argparser 0.3.1 → 0.3.2
raw patch · 3 files changed
+9/−15 lines, 3 files
Files
- argparser.cabal +2/−2
- src/System/Console/ArgParser.hs +6/−12
- src/System/Console/ArgParser/Run.hs +1/−1
argparser.cabal view
@@ -1,5 +1,5 @@ name: argparser -version: 0.3.1 +version: 0.3.2 cabal-version: >=1.8 build-type: Simple author: Simon Bergot <simon.bergot@gmail.com> @@ -30,7 +30,7 @@ source-repository head type: git - location: https://github.com/sbergot/EasyConsole + location: https://github.com/sbergot/ArgParser test-suite TestsHTF type: exitcode-stdio-1.0
src/System/Console/ArgParser.hs view
@@ -12,26 +12,20 @@ consume and convert command line arguments. Default special action such as help/usage are automatically built from the parser specification. -Here is a quick example. First, we need a datatype: +Here is a quick example. @ -data MyTest = MyTest Int Int +data MyTest = -- First, we need a datatype + MyTest Int Int deriving (Show) -- we will print the values -@ -Then, we define a parser: - -@ -myTestParser :: ParserSpec MyTest +myTestParser -- Then, we define a parser + :: ParserSpec MyTest myTestParser = MyTest \`parsedBy\` reqPos \"pos1\" \`andBy\` optPos 0 \"pos2\" -@ -we proceed to build an interface and run it: - -@ -main = do +main = do -- We proceed to build an interface and run it: interface <- mkApp myTestParser runApp interface print @
src/System/Console/ArgParser/Run.hs view
@@ -111,7 +111,7 @@ setAppDescr :: CmdLnInterface a -> String -> CmdLnInterface a setAppDescr app descr = app {getAppDescr = Just descr } --- | Set the description of an interface +-- | Set the bottom text of an interface setAppEpilog :: CmdLnInterface a -> String -> CmdLnInterface a setAppEpilog app descr = app {getAppEpilog = Just descr }