Class: BoxCli::SettingsCommand
- Defined in:
- lib/box_cli/settings_command.rb
Constant Summary
Constants inherited from Command
Instance Attribute Summary
Attributes inherited from Command
#args, #global_options, #local_options
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options, args) ⇒ SettingsCommand
constructor
A new instance of SettingsCommand.
Constructor Details
#initialize(options, args) ⇒ SettingsCommand
Returns a new instance of SettingsCommand.
3 4 5 6 |
# File 'lib/box_cli/settings_command.rb', line 3 def initialize(, args) super collect_globals_from_env end |
Instance Method Details
#call ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/box_cli/settings_command.rb', line 8 def call STDOUT.puts("Options:\n".tap do |s| if @options.__hash__.empty? s << " (none)\n" else s << @options.__hash__.keys.map(&:to_s).sort.map { |k| " %s: %s" % [k, @options.__hash__[k.to_sym]] }.join("\n") end s << "\n\nArguments:\n" if @args.empty? s << " (none)\n" else s << @args.map { |p| " #{p}" }.join("\n") end end) end |