Class: Fp::Commands::ConfigCmd

Inherits:
Base
  • Object
show all
Defined in:
lib/fp/commands/config_cmd.rb

Overview

fp config get|set|unset|list Manage global CLI settings (stored in ~/.config/fp/config.yml)

Constant Summary collapse

ALLOWED_SETTINGS =
%w[api_url].freeze

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Fp::Commands::Base

Instance Method Details

#run(args) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/fp/commands/config_cmd.rb', line 10

def run(args)
  subcommand = args.shift

  case subcommand
  when 'set'
    set_setting(args)
  when 'get'
    get_setting(args)
  when 'unset'
    unset_setting(args)
  when 'list'
    list_settings
  else
    show_usage
  end
end