Safe Haskell | None |
---|---|
Language | Haskell98 |
- type CmdAction a = ErrorT String Maybe a
- notMatch :: CmdAction a
- failMatch :: String -> CmdAction a
- runCmd :: Cmd a -> Args -> CmdAction a
- defaultOpts :: Opts String -> Cmd a -> Cmd a
- validateArgs :: (Args -> CmdAction ()) -> Cmd a -> Cmd a
- alterArgs :: (Args -> CmdAction Args) -> Cmd a -> Cmd a
- data Cmd a = Cmd {}
- cmdAct :: (b -> a) -> b -> CmdAction a
- cutName :: String -> Args -> CmdAction Args
- cmda :: String -> [String] -> [Opt] -> String -> (Args -> CmdAction a) -> Cmd a
- cmda_ :: String -> [Opt] -> String -> (Opts String -> CmdAction a) -> Cmd a
- cmd :: String -> [String] -> [Opt] -> String -> (Args -> a) -> Cmd a
- cmd_ :: String -> [Opt] -> String -> (Opts String -> a) -> Cmd a
- defCmd :: [String] -> [Opt] -> String -> (Args -> a) -> Cmd a
- data CmdHelp
- = HelpUsage [String]
- | HelpCommands [(String, [String])]
- helpCommand :: String -> (Either String CmdHelp -> a) -> [Cmd a] -> Cmd a
- withHelp :: String -> (Either String CmdHelp -> a) -> [Cmd a] -> [Cmd a]
- printWith :: (String -> a) -> Either String CmdHelp -> a
- run :: [Cmd a] -> a -> (String -> a) -> [String] -> a
- runArgs :: [Cmd a] -> a -> (String -> a) -> Args -> a
- runOn :: [Cmd a] -> a -> (String -> a) -> (Cmd a -> c -> Args) -> c -> a
- module System.Console.Args
Documentation
cutName :: String -> Args -> CmdAction Args Source
Cut name of command from arguments and checks if it matches
cutName >=> cmdAct act
HelpUsage [String] | |
HelpCommands [(String, [String])] |
helpCommand :: String -> (Either String CmdHelp -> a) -> [Cmd a] -> Cmd a Source
Make help command, which will show help on for specified commands
module System.Console.Args