abstract class Geode::Commands::Base
- Geode::Commands::Base
- Cling::Command
- Reference
- Object
Direct Known Subclasses
- Geode::CLI
- Geode::Commands::Build
- Geode::Commands::Config
- Geode::Commands::Config::Set
- Geode::Commands::Config::Setup
- Geode::Commands::Create
- Geode::Commands::Info
- Geode::Commands::Init
- Geode::Commands::Install
- Geode::Commands::List
- Geode::Commands::Remove
- Geode::Commands::Run
- Geode::Commands::Template
- Geode::Commands::Template::Create
- Geode::Commands::Template::List
- Geode::Commands::Version
- Geode::Commands::Watch
Defined in:
commands/base.crConstructors
Instance Method Summary
-
#help_template : String
Returns the help template for this command.
-
#on_error(ex : Exception)
A hook method for when the command raises an exception during execution.
-
#on_invalid_option(message : String)
A hook method for when the command receives an invalid option, for example, a value given to an option that takes no arguments.
-
#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) : Bool
A hook method to run once the command/subcommands, arguments and options have been parsed.
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 an invalid option, for example, a value given to
an option that takes no arguments. By default, this raises a CommandError
.
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.
Accepts a Bool
or nil
argument as a return to specify whether the command should continue
to run once finished (true
or nil
to continue, false
to stop).