-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple command args parsing and execution -- -- This is a small wrapper over optparse-applicative which allows -- combining args parsers directly with IO commands. For subcommands this -- can avoid type boilerplate. It also provides a few functions for -- common Mod combinations. @package simple-cmd-args @version 0.1.1 -- | This library provides a thin layer on optparse-applicative argument -- and option parsing, using Parser (IO ()), applying commands -- directly to their argument parsing. -- -- A few option Mod functions are also provided. module SimpleCmdArgs -- | Parser executor (allows interspersed args and options) -- --
-- simpleCmdArgs (Just version) "summary" "program description" $ myCommand <$> myOptParser <*> myargsParser --simpleCmdArgs :: Maybe Version -> String -> String -> Parser (IO ()) -> IO () -- | Parser executor without interspersing options and args -- --
-- simpleCmdArgs' Nothing "summary" "program description" $ myCommand <$> myOptParser <*> myargsParser --simpleCmdArgs' :: Maybe Version -> String -> String -> Parser (IO ()) -> IO () -- | Generic parser executor with explicit info modifiers simpleCmdArgsWithMods :: Maybe Version -> InfoMod (IO ()) -> Parser (IO ()) -> IO () -- |
-- Subcommand "command" "help description text" $ myCommand <$> optParser --data Subcommand Subcommand :: String -> String -> Parser (IO ()) -> Subcommand -- | list of Subcommand that can be run by simpleCmdArgs subcommands :: [Subcommand] -> Parser (IO ()) -- | A string arg parser with a METAVAR for help strArg :: String -> Parser String -- | switch with Mods -- --
-- switchWith 'o' "option" "help description" --switchWith :: Char -> String -> String -> Parser Bool -- | Mods for a switch. -- --
-- switchMods 'o' "option" "help description" --switchMods :: HasName f => Char -> String -> String -> Mod f a -- | strOption with Mods -- --
-- strOptionWith 'o' "option" "METAVAR" "help description" --strOptionWith :: Char -> String -> String -> String -> Parser String -- | option with Mods -- --
-- optionWith 'o' "option" "METAVAR" "help description" --optionWith :: ReadM a -> Char -> String -> String -> String -> Parser a -- | Mods for a mandatory option. -- --
-- optionMods 'o' "option" "METAVAR" "help description" --optionMods :: (HasMetavar f, HasName f) => Char -> String -> String -> String -> Mod f a -- | strOptional with Mods -- --
-- strOptionalWith 'o' "option" "METAVAR" "help description" default --strOptionalWith :: Char -> String -> String -> String -> String -> Parser String -- | optional option with Mods, includes a default value. -- --
-- optionalWith 'o' "option" "METAVAR" "help description" default --optionalWith :: ReadM a -> Char -> String -> String -> String -> a -> Parser a -- | Mods for an optional option: includes a default value. -- --
-- optionalMods 'o' "option" "METAVAR" "help description" default --optionalMods :: (HasMetavar f, HasName f, HasValue f) => Char -> String -> String -> String -> a -> Mod f a -- | argument with METAVAR -- --
-- argumentWith auto "METAVAR" --argumentWith :: ReadM a -> String -> Parser a