abstract class Docr::Commands::Base
- Docr::Commands::Base
- Cling::Command
- Reference
- Object
Direct Known Subclasses
- Docr::App
- Docr::Commands::About
- Docr::Commands::Add
- Docr::Commands::Env
- Docr::Commands::Env::Init
- Docr::Commands::Info
- Docr::Commands::List
- Docr::Commands::Remove
- Docr::Commands::Search
- Docr::Commands::Update
- Docr::Commands::Version
Defined in:
commands/base.crConstructors
Instance Method Summary
- #debug(data : _) : Nil
- #error(data : _) : Nil
-
#help_template : String
Returns the help template for this command.
- #info(data : _) : Nil
-
#on_error(ex : Exception)
A hook method for when the command raises an exception during execution.
-
#on_missing_arguments(args : Array(String))
A hook method for when the command receives missing arguments during execution.
-
#on_unknown_arguments(args : Array(String))
A hook method for when the command receives unknown arguments during execution.
-
#on_unknown_options(options : Array(String))
A hook method for when the command receives unknown options during execution.
-
#pre_run(arguments : Cling::Arguments, options : Cling::Options) : Nil
A hook method to run once the command/subcommands, arguments and options have been parsed.
- #warn(data : _) : Nil
Constructor Detail
Instance Method Detail
Returns the help template for this command. By default, one is generated interally unless this method is overridden.
A hook method for when the command raises an exception during execution. By default, this raises the exception.
A hook method for when the command receives missing arguments during execution. By default,
this raises a CommandError
.
A hook method for when the command receives unknown arguments during execution. By default,
this raises a CommandError
.
A hook method for when the command receives unknown options during execution. By default,
this raises an CommandError
.
A hook method to run once the command/subcommands, arguments and options have been parsed.
This has access to the parsed arguments and options from the command line. This is useful if
you want to implement checks for specific flags outside of the main run
method, such as
-v
/--version
flags or -h
/--help
flags.