argparser-0.3.3: Command line parsing framework for console applications

Portabilityportable
Stabilityunstable
Maintainersimon.bergot@gmail.com
Safe HaskellSafe-Inferred

System.Console.ArgParser.Run

Contents

Description

Functions used to build and run command line applications.

Synopsis

Running a parser

withParseResult :: ParserSpec a -> (a -> IO ()) -> IO ()Source

Runs an apllication with the user provided arguments. It is a shorter way of calling mkApp and runApp

runAppSource

Arguments

:: 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

parseArgsSource

Arguments

:: Args

Arguments to parse

-> CmdLnInterface a

Command line spec

-> ParseResult a 

Parse the arguments with the parser provided to the function.

parseNiceArgsSource

Arguments

:: 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