-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A framework for friendly commandline programs -- -- This is a framework for creating commandline applications. It provides -- various features which give a polished feel to your application. -- -- It is designed to encourage you to provide clear documentation and -- working examples. It implements default ''help'' and ''man'' commands -- for your application, which will layout help text and generate -- Unix-style man pages. -- -- It provides special handling for applications of the form ''program -- command args'', the style of interaction common in revision control -- systems. It will dispatch to handler functions that you provide for -- each command, and also provide command-specific help to the user. @package ui-command @version 0.5.0 module UI.Command type App config = ReaderT (AppContext config) IO -- | Get the application arguments appArgs :: (Default config) => App config [String] -- | Get the application config appConfig :: (Default config) => App config config -- | It is often simpler to use the default implementation of Application, -- and override it with the details you choose to use. For example, an -- implementation of the ''hello'' command: -- --
-- hello = def {
-- appName = "hello",
-- appVersion = "0.1",
-- appAuthors = ["Joe R. Hacker"],
-- appBugEmail = "bugs@example.com",
-- appShortDesc = "UI.Command example program",
-- appLongDesc = longDesc,
-- appCategories = ["Greetings", "Cat Math"],
-- appSeeAlso = ["tractorgen"],
-- appProject = "Haskell",
-- appCmds = [world, times]
-- }
--
-- longDesc = "a demonstration program for the UI.Command framework."
--
data (Default opts, Default config) => Application opts config
Application :: String -> String -> String -> [String] -> String -> String -> [String] -> String -> [String] -> [Command config] -> [OptDescr opts] -> (config -> [opts] -> IO config) -> Application opts config
-- | Name of the program
appName :: Application opts config -> String
-- | Software version
appVersion :: Application opts config -> String
-- | Email address to report bugs to
appBugEmail :: Application opts config -> String
-- | Names of authors
appAuthors :: Application opts config -> [String]
-- | One-line description of the command
appShortDesc :: Application opts config -> String
-- | Long description of the command
appLongDesc :: Application opts config -> String
-- | Categories to show in help text, in order of appearance
appCategories :: Application opts config -> [String]
-- | Project that this command is part of
appProject :: Application opts config -> String
-- | Related commands
appSeeAlso :: Application opts config -> [String]
-- | The actual commands
appCmds :: Application opts config -> [Command config]
-- | Union of all options accepted by the application's commands. Note that
-- options '-h', -?, '--help', '-V', '--version' will be
-- automatically added and handled by UI.Command
appOptions :: Application opts config -> [OptDescr opts]
-- | Function to process options
appProcessConfig :: Application opts config -> config -> [opts] -> IO config
-- | It is often simpler to use the default implementation of Command, and
-- override it with the details you choose to use. For example, an
-- implementation of the ''hello world'' command:
--
--
-- world = def {
-- cmdName = "world",
-- cmdHandler = worldHandler,
-- cmdCategory = "Greetings",
-- cmdShortDesc = "An implementation of the standard software greeting."
-- }
--
-- worldHandler = liftIO $ putStrLn "Hello world!"
--
data (Default config) => Command config
Command :: String -> App config () -> String -> String -> String -> [(String, String)] -> Command config
-- | Name of the cmdcommand
cmdName :: Command config -> String
-- | Handler
cmdHandler :: Command config -> App config ()
-- | Category in this program's documentation
cmdCategory :: Command config -> String
-- | Synopsis
cmdSynopsis :: Command config -> String
-- | Short description
cmdShortDesc :: Command config -> String
-- | -- main = appMain hello --appMain :: Application () () -> IO () appMainWithOptions :: (Default opts, Default config) => Application opts config -> IO ()