argparser-0.3.3: Command line parsing framework for console applications

Copyright(c) Simon Bergot
LicenseBSD3
Maintainersimon.bergot@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell98

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

runApp Source

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

parseArgs Source

Arguments

:: Args

Arguments to parse

-> CmdLnInterface a

Command line spec

-> ParseResult a 

Parse the arguments with the parser provided to the function.

parseNiceArgs Source

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 a Source

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 a Source

Set the description of an interface

setAppEpilog :: CmdLnInterface a -> String -> CmdLnInterface a Source

Set the bottom text of an interface

setAppName :: CmdLnInterface a -> String -> CmdLnInterface a Source

Set the name of an interface