Safe Haskell | None |
---|---|
Language | Haskell2010 |
Declarative options parser
- class IsCmd c
- data Cmd help a
- logStr :: Int -> String -> Cmd help ()
- getVerbosity :: Cmd help Int
- getLogger :: MonadIO m => Cmd a (Int -> String -> m ())
- class Option a where
- data Flag shortNames longNames placeholder help a
- data Arg placeholder a
- class ArgRead a where
- data Def defaultValue a
- data Group = Group {}
- data SubCmd
- subCmd :: IsCmd c => String -> c -> SubCmd
- run :: IsCmd c => String -> Maybe String -> c -> IO ()
- run_ :: IsCmd c => c -> IO ()
Command type
Command class
runCmd
IsCmd Group | |
(KnownSymbol placeholder, IsCmd c) => IsCmd (Arg placeholder [String] -> c) | |
(KnownSymbol placeholder, IsCmd c) => IsCmd (Arg placeholder String -> c) | |
(KnownSymbol shortNames, KnownSymbols longNames, KnownSymbol placeholder, KnownSymbol help, ArgRead a, IsCmd c) => IsCmd (Flag shortNames longNames placeholder help a -> c) | |
KnownSymbol help => IsCmd (Cmd help ()) |
Command
Output string when the verbosity level is greater than or equal to logLevel
getVerbosity :: Cmd help Int Source
Return the verbosity level ('--verbosity=n')
Argument definition tools
Command line option
data Flag shortNames longNames placeholder help a Source
Named argument
(KnownSymbol shortNames, KnownSymbols longNames, KnownSymbol placeholder, KnownSymbol help, ArgRead a, IsCmd c) => IsCmd (Flag shortNames longNames placeholder help a -> c) | |
ArgRead a => Option (Flag _a _b _c _d a) | |
type Value (Flag _a _b _c _d a) = Unwrap a |
Unnamed argument
Defining argment types
Command line option's annotated types
Nothing