Class: Zold::Args
- Inherits:
-
Object
- Object
- Zold::Args
- Defined in:
- lib/zold/commands/args.rb
Overview
Command line args
Instance Method Summary collapse
-
#initialize(opts, log) ⇒ Args
constructor
A new instance of Args.
- #take ⇒ Object
Constructor Details
#initialize(opts, log) ⇒ Args
Returns a new instance of Args.
20 21 22 23 |
# File 'lib/zold/commands/args.rb', line 20 def initialize(opts, log) @opts = opts @log = log end |
Instance Method Details
#take ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/zold/commands/args.rb', line 25 def take if @opts.help? @log.info(@opts.to_s) return end args = @opts.arguments.reject { |a| a.start_with?('-') } raise 'Try --help' if args.empty? args[1..-1] end |