Class: Switchboard::Commands::Config

Inherits:
Switchboard::Command show all
Defined in:
lib/switchboard/commands/config/config.rb

Class Method Summary collapse

Methods inherited from Switchboard::Command

description, help, options, to_command, to_command_name

Class Method Details

.run!Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/switchboard/commands/config/config.rb', line 6

def self.run!
  settings = Switchboard::Settings.new
  if ARGV.empty?
    super
  elsif ARGV.length == 1
    puts settings.get(ARGV.shift)
  elsif ARGV.length == 2
    settings.set!(ARGV.shift, ARGV.shift)
  else
    puts "error: More than one value for the key #{ARGV.shift}: #{ARGV * " "}"
  end
end