| Copyright | (c) Frederick Pringle 2023 |
|---|---|
| License | BSD-3-Clause |
| Maintainer | freddyjepringle@gmail.com |
| Safe Haskell | None |
| Language | Haskell2010 |
Hoyo.CLI.Parse
Description
Parse CLI arguments.
Synopsis
- options :: ParserInfo Options
- parseOptions :: Parser Options
- parseCommand :: Parser Command
- globalOptions :: Parser GlobalOptions
- overrideOptions :: Parser OverrideOptions
- addCommand :: Parser Command
- moveCommand :: Parser Command
- listCommand :: Parser Command
- clearCommand :: Parser Command
- deleteCommand :: Parser Command
- checkCommand :: Parser Command
- defaultCommand :: Parser Command
- configCommand :: Parser Command
- configPrintCommand :: Parser ConfigCommand
- configResetCommand :: Parser ConfigCommand
- configSetCommand :: Parser ConfigCommand
- configAddDefaultCommand :: Parser ConfigCommand
- splitArgs :: Text -> [String]
- showHelp :: Maybe String -> IO ()
Parsing CLI arguments and options
options :: ParserInfo Options Source #
A ParserInfo object containing the necessary information for parsing
CLI commands and arguments, and displaying useful help text.
parseOptions :: Parser Options Source #
Parse an Options argument, which includes the command
to run and any global options.
parseCommand :: Parser Command Source #
Parse a command and the arguments/options for that command from the command-line arguments.
globalOptions :: Parser GlobalOptions Source #
Parse global options: options that can be set on the command line no matter what sub-command is being run.
For a complete list of the global options, see GlobalOptions or
run hoyo --help.
overrideOptions :: Parser OverrideOptions Source #
Parse override options: options that override config settings. This can be useful when you want to temporarily enable functionality for one CLI run, but don't want to change it in the config file.
Parsing specific CLI commands
addCommand :: Parser Command Source #
Parse options for the hoyo add command.
moveCommand :: Parser Command Source #
Parse options for the hoyo move command.
listCommand :: Parser Command Source #
Parse options for the hoyo list command.
clearCommand :: Parser Command Source #
Parse options for the hoyo clear command.
deleteCommand :: Parser Command Source #
Parse options for the hoyo delete command.
checkCommand :: Parser Command Source #
Parse options for the hoyo check command.
defaultCommand :: Parser Command Source #
If hoyo is run with no arguments, we run the "default command" if it's set.
Parsing sub-commands for hoyo config
configCommand :: Parser Command Source #
Parse options for the hoyo config command.
configPrintCommand :: Parser ConfigCommand Source #
Parse options for the hoyo config print sub-command.
configResetCommand :: Parser ConfigCommand Source #
Parse options for the hoyo config reset sub-command.
configSetCommand :: Parser ConfigCommand Source #
Parse options for the hoyo config set sub-command.
configAddDefaultCommand :: Parser ConfigCommand Source #
Parse options for the hoyo config add-default sub-command.