abstract class CLI::MainCommand

Defined in:

cli/helper.cr

Instance Method Summary

Instance methods inherited from class CLI::Command

add_alias(name : String) : Nil add_alias, add_aliases(*names : String) : Nil add_aliases, add_argument(name : String, *, desc : String | Nil = nil, required : Bool = false) : Nil add_argument, add_command(command : Command) : Nil add_command, add_commands(*commands : Command) : Nil add_commands, add_option(short : Char, long : String, *, desc : String | Nil = nil, required : Bool = false, has_value : Bool = false, default : Value::Type = nil) : Nil
add_option(long : String, *, desc : String | Nil = nil, required : Bool = false, has_value : Bool = false, default : Value::Type = nil) : Nil
add_option
, add_usage(usage : String) : Nil add_usage, aliases : Set(String) aliases, arguments : Hash(String, Argument) arguments, children : Hash(String, Command) children, description : String | Nil description, description=(description : String | Nil) description=, execute(input : String | Array(String), *, parser : Parser | Nil = nil) : Nil execute, footer : String | Nil footer, footer=(footer : String | Nil) footer=, header : String | Nil header, header=(header : String | Nil) header=, help_template : String help_template, hidden=(hidden : Bool) hidden=, hidden? : Bool hidden?, inherit_borders=(inherit_borders : Bool) inherit_borders=, inherit_borders? : Bool inherit_borders?, inherit_options=(inherit_options : Bool) inherit_options=, inherit_options? : Bool inherit_options?, inherit_streams=(inherit_streams : Bool) inherit_streams=, inherit_streams? : Bool inherit_streams?, is?(name : String) : Bool is?, name : String name, name=(name : String) name=, on_error(ex : Exception) on_error, on_missing_arguments(args : Array(String)) on_missing_arguments, on_missing_options(options : Array(String)) on_missing_options, on_unknown_arguments(args : Array(String)) on_unknown_arguments, on_unknown_options(options : Array(String)) on_unknown_options, options : Hash(String, Option) options, parent : Command | Nil parent, parent=(parent : Command | Nil) parent=, post_run(args : ArgsInput, options : OptionsInput) : Nil post_run, pre_run(args : ArgsInput, options : OptionsInput) : Bool | Nil pre_run, run(args : ArgsInput, options : OptionsInput) : Nil run, setup : Nil setup, stderr : IO stderr, stderr=(stderr : IO) stderr=, stdin : IO stdin, stdin=(stdin : IO) stdin=, stdout : IO stdout, stdout=(stdout : IO) stdout=, summary : String | Nil summary, summary=(summary : String | Nil) summary=, usage : Array(String) usage

Constructor methods inherited from class CLI::Command

new(*, aliases : Set(String) | Nil = nil, usage : Array(String) | Nil = nil, header : String | Nil = nil, summary : String | Nil = nil, description : String | Nil = nil, footer : String | Nil = nil, parent : Command | Nil = nil, children : Array(Command) | Nil = nil, arguments : Hash(String, Argument) | Nil = nil, options : Hash(String, Option) | Nil = nil, hidden : Bool = false, inherit_borders : Bool = false, inherit_options : Bool = false, inherit_streams : Bool = false, stdin : IO = STDIN, stdout : IO = STDOUT, stderr : IO = STDERR) new

Instance Method Detail

def pre_run(args, options) #

[View source]
def setup : Nil #
Description copied from class CLI::Command

An abstract method that should define information about the command such as the name, aliases, arguments, options, etc. The command name is required for all commands, all other values are optional including the help message.


[View source]