Class: Luban::CLI::Command
Constant Summary
Constants inherited from Base
Base::DefaultSummaryIndent, Base::DefaultSummaryWidth, Base::DefaultTitleIndent
Instance Attribute Summary collapse
-
#command_chain ⇒ Object
readonly
Returns the value of attribute command_chain.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Base
#action_method, #app, #arguments, #default_argv, #description, #options, #prefix, #program_name, #result, #summary, #summary_indent, #summary_width, #title_indent, #version
Instance Method Summary collapse
- #default_prefix ⇒ Object
-
#initialize(app, name, command_chain: [name], **opts, &config_blk) ⇒ Command
constructor
A new instance of Command.
Methods inherited from Base
#action, #action!, #argument, configure, #default_program_name, #desc, #help, help_command, #long_desc, #option, #parse, #parse!, #parser, #program, #reset, #show_help, #show_help_for_command, #show_version, #switch
Methods included from Commands
Constructor Details
#initialize(app, name, command_chain: [name], **opts, &config_blk) ⇒ Command
Returns a new instance of Command.
7 8 9 10 11 |
# File 'lib/luban/cli/command.rb', line 7 def initialize(app, name, command_chain: [name], **opts, &config_blk) @name = name @command_chain = command_chain super(app, name, **opts, &config_blk) end |
Instance Attribute Details
#command_chain ⇒ Object (readonly)
Returns the value of attribute command_chain.
5 6 7 |
# File 'lib/luban/cli/command.rb', line 5 def command_chain @command_chain end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/luban/cli/command.rb', line 4 def name @name end |
Instance Method Details
#default_prefix ⇒ Object
13 |
# File 'lib/luban/cli/command.rb', line 13 def default_prefix; '__command_'; end |