-- 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, avoiding command
--   type boilerplate. It supports subcommands and also provides a few
--   option Mod functions.
@package simple-cmd-args
@version 0.1.0.1


-- | This library provides a thin layer on optparse-applicative argument
--   and option parsing, using <tt>Parser (IO ())</tt>, applying commands
--   directly to their argument parsing.
--   
--   A few option Mod functions are also provided.
module SimpleCmdArgs

-- | Parser executor (allows interspersed args and options)
--   
--   <pre>
--   simpleCmdArgs (Just version) "summary" "program description" $ myCommand &lt;$&gt; myOptParser &lt;*&gt; myargsParser
--   </pre>
simpleCmdArgs :: Maybe Version -> String -> String -> Parser (IO ()) -> IO ()

-- | Parser executor without interspersing options and args
--   
--   <pre>
--   simpleCmdArgs' Nothing "summary" "program description" $ myCommand &lt;$&gt; myOptParser &lt;*&gt; myargsParser
--   </pre>
simpleCmdArgs' :: Maybe Version -> String -> String -> Parser (IO ()) -> IO ()

-- | <pre>
--   Subcommand "command" "help description text" $ myCommand &lt;$&gt; optParser
--   </pre>
data Subcommand
Subcommand :: String -> String -> Parser (IO ()) -> Subcommand

-- | list of <tt>Subcommand</tt> that can be run by <tt>simpleCmdArgs</tt>
subcommands :: [Subcommand] -> Parser (IO ())

-- | A string arg parser with a METAVAR for help
strArg :: String -> Parser String

-- | <tt>Mod</tt>s for a switch.
--   
--   <pre>
--   switchMods 'o' "option" "help description"
--   </pre>
switchMods :: HasName f => Char -> String -> String -> Mod f a

-- | <tt>Mod</tt>s for a mandatory option.
--   
--   <pre>
--   optionMods 'o' "option" "METAVAR" "help description"
--   </pre>
optionMods :: (HasMetavar f, HasName f) => Char -> String -> String -> String -> Mod f a

-- | <tt>Mod</tt>s for an optional option: includes a default value.
--   
--   <pre>
--   optionalMods 'o' "option" "METAVAR" "help description" default
--   </pre>
optionalMods :: (HasMetavar f, HasName f, HasValue f) => Char -> String -> String -> String -> a -> Mod f a
