lambda-options-0.9.0.0: A modern command-line parser for Haskell.

Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.LambdaOptions.Keyword

Synopsis

Documentation

data Keyword Source

An option keyword, such as "--help"

Constructors

Keyword 

Fields

kwNames :: [String]

All the aliases for this keyword.

kwArgText :: String

Text to describe the arguments to the option given by this keyword.

kwText :: String

Text to describe the function of the option given by this keyword.

class ToKeyword a where Source

Convenience Keyword creation class.

Methods

toKeyword :: a -> Keyword Source

Instances

ToKeyword String

Used to create a Keyword with a single alias.

ToKeyword Keyword

Identiy mapping.

ToKeyword [String]

Used to create a Keyword with many (or no) aliases

kw :: ToKeyword a => a -> Keyword Source

Shorthand for toKeyword.

argText :: Keyword -> String -> Keyword Source

Sets the kwArgText field in the keyword. Intended to be used infix:

kw "--directory" `argText` "DIR" `text` "Write files to DIR."

text :: Keyword -> String -> Keyword Source

Sets the kwText field in the keyword. Intended to be used infix.

kw "--quiet" `text` "Suppress message display."