Class: Renuo::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/renuo/cli.rb

Class Method Summary collapse

Class Method Details

.start ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/renuo/cli.rb', line 7

def self.start
  require 'commander/import'
  program :version, '0.0.1'
  program :description, 'renuo CLI'

  command 'display-name'.to_sym do |c|
    c.syntax = 'renuo display-name [options]'
    c.summary = 'displays the name of a customer'
    c.description = ''
    c.example 'description', 'command example'
    c.option '--delete', 'Deletes the current name'
    c.action do |args, _options|
      NameDisplay.new.display_name(args)
    end
  end

  command :config do |c|
    c.syntax = 'renuo config [options]'
    c.summary = ''
    c.description = ''
    c.example 'description', 'command example'
    c.option '--some-switch', 'Some switch that does something'
    c.action do |_args, _options|
      key = ask('API Key?') { |q| q.echo = '*' }
      LocalStorage.new.store(:api_key, key)
      say('stored the api key')
    end
  end
end