butcher-1.1.0.0: Chops a command or program invocation into digestable pieces.

Description

Parameters are arguments of your current command that are not prefixed by some flag. Typical commandline interface is something like "PROGRAM [FLAGS] INPUT". Here, FLAGS are Flags in butcher, and INPUT is a Param, in this case a String representing a path, for example.

Synopsis

# Documentation

data Param p Source #

param-description monoid. You probably won't need to use the constructor; mzero or any (<>) of param(Help|Default|Suggestion) works well.

Constructors

 Param Fields_param_default :: Maybe p _param_help :: Maybe Doc _param_suggestions :: Maybe [p]

Instances

 Monoid (Param p) Source # Methodsmempty :: Param p #mappend :: Param p -> Param p -> Param p #mconcat :: [Param p] -> Param p #

Create a Param with just a help text.

Create a Param with just a help text.

paramDefault :: p -> Param p Source #

Create a Param with just a default value.

paramSuggestions :: [p] -> Param p Source #

Create a Param with just a list of suggestion values.

Arguments

 :: (Applicative f, Typeable a, Show a, Read a) => String paramater name, for use in usage/help texts -> Param a properties -> CmdParser f out a

Add a parameter to the CmdParser by making use of a Read instance. Take care not to use this to return Strings unless you really want that, because it will require the quotation marks and escaping as is normal for the Show/Read instances for String.

Arguments

 :: (Applicative f, Typeable a, Read a) => String paramater name, for use in usage/help texts -> Param a properties -> CmdParser f out (Maybe a)

Add a parameter that matches any string of non-space characters if input String, or one full argument if input is [String]. See the Input doc for this distinction.
Like addStringParam, but optional, I.e. succeeding with Nothing if there is no remaining input.