-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple interface to optparse-applicative -- @package optparse-simple @version 0.0.0 -- | Simple interface to program arguments. -- -- Typical usage with no commands: -- --
-- do (opts,()) <- -- simpleOptions "ver" -- "header" -- "desc" -- (flag () () (long "some-flag")) -- empty -- doThings opts ---- -- Typical usage with commands: -- --
-- do (opts,runCmd) <- -- simpleOptions "ver" -- "header" -- "desc" -- (pure ()) $ -- do addCommand "delete" -- "Delete the thing" -- (const deleteTheThing) -- (pure ()) -- addCommand "create" -- "Create a thing" -- createAThing -- (strOption (long "hello")) -- runCmd --module Options.Applicative.Simple -- | Generate a simple options parser. simpleOptions :: String -> String -> String -> Parser a -> EitherT b (Writer (Mod CommandFields b)) () -> IO (a, b) -- | Generate a string like Version 1.2, Git revision 1234. -- -- $(simpleVersion …) :: String simpleVersion :: Version -> Q Exp -- | Add a command to the options dispatcher. addCommand :: String -> String -> (a -> b) -> Parser a -> EitherT b (Writer (Mod CommandFields b)) ()