Module: Ratch::CLI
- Included in:
- Script
- Defined in:
- lib/ratch/utils/cli.rb
Overview
TODO: How best to support CLI interface?
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.extended(base) ⇒ Object
12 13 14 |
# File 'lib/ratch/utils/cli.rb', line 12 def self.extended(base) require 'facets/argvector' end |
.included(base) ⇒ Object
7 8 9 |
# File 'lib/ratch/utils/cli.rb', line 7 def self.included(base) require 'facets/argvector' end |
Instance Method Details
#arguments ⇒ Object
32 33 34 |
# File 'lib/ratch/utils/cli.rb', line 32 def arguments @arguments end |
#initialize(*args) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ratch/utils/cli.rb', line 17 def initialize(*args) argv = ArgVector.new(ARGV) @arguments, parameters = *argv.parameters args << {} unless Hash === args.last opts = args.last opts.merge!(parameters) super(*args) end |