Portability | portable |
---|---|
Stability | unstable |
Maintainer | simon.bergot@gmail.com |
Safe Haskell | Safe-Inferred |
Functions used to build and run command line applications.
- runApp :: CmdLnInterface a -> (a -> IO ()) -> IO ()
- parseArgs :: Args -> CmdLnInterface a -> ParseResult a
- parseNiceArgs :: NiceArgs -> CmdLnInterface a -> ParseResult a
- mkApp :: ParserSpec a -> IO (CmdLnInterface a)
- mkDefaultApp :: ParserSpec a -> String -> CmdLnInterface a
- defaultSpecialFlags :: [SpecialFlag a]
- setAppDescr :: CmdLnInterface a -> String -> CmdLnInterface a
- setAppEpilog :: CmdLnInterface a -> String -> CmdLnInterface a
- setAppName :: CmdLnInterface a -> String -> CmdLnInterface a
Running a parser
:: CmdLnInterface a | Command line spec |
-> (a -> IO ()) | Process to run if the parsing success |
-> IO () |
Runs a command line application with the user provided arguments. If the parsing succeeds, run the application. Print the returned message otherwise
:: Args | Arguments to parse |
-> CmdLnInterface a | Command line spec |
-> ParseResult a |
Parse the arguments with the parser provided to the function.
:: NiceArgs | Arguments to parse |
-> CmdLnInterface a | Command line spec |
-> ParseResult a |
Parse the arguments with the parser provided to the function.
Building a parser
mkApp :: ParserSpec a -> IO (CmdLnInterface a)Source
Build an application with no version/description and with a name equal to the file name.
mkDefaultApp :: ParserSpec a -> String -> CmdLnInterface aSource
Build an application with no version/description and with a name equal to the provided String.
defaultSpecialFlags :: [SpecialFlag a]Source
default version and help special actions
setAppDescr :: CmdLnInterface a -> String -> CmdLnInterface aSource
Set the description of an interface
setAppEpilog :: CmdLnInterface a -> String -> CmdLnInterface aSource
Set the bottom text of an interface
setAppName :: CmdLnInterface a -> String -> CmdLnInterface aSource
Set the name of an interface