Class: Clin::Command
- Inherits:
-
Object
- Object
- Clin::Command
- Defined in:
- lib/clin/command.rb
Overview
Clin Command
Instance Attribute Summary collapse
-
#params ⇒ Object
Contains the parameters.
-
#shell ⇒ Object
Contains a shell object for user interaction in the command.
Class Method Summary collapse
-
.parse(argv = ARGV, fallback_help: true) ⇒ Object
Parse the command and initialize the command object with the parsed options.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Command
constructor
A new instance of Command.
Constructor Details
Instance Attribute Details
#params ⇒ Object
Contains the parameters
22 23 24 |
# File 'lib/clin/command.rb', line 22 def params @params end |
#shell ⇒ Object
Contains a shell object for user interaction in the command
26 27 28 |
# File 'lib/clin/command.rb', line 26 def shell @shell end |
Class Method Details
.parse(argv = ARGV, fallback_help: true) ⇒ Object
Parse the command and initialize the command object with the parsed options
16 17 18 19 |
# File 'lib/clin/command.rb', line 16 def self.parse(argv = ARGV, fallback_help: true) parser = Clin::CommandParser.new(self, argv, fallback_help: fallback_help) parser.parse end |