Class: Invocker::OptpareOptions::Executes

Inherits:
Object
  • Object
show all
Defined in:
lib/invocker/optparsr_options/config.rb

Class Method Summary collapse

Class Method Details

.define(parser, script_options) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/invocker/optparsr_options/config.rb', line 4

def self.define(parser, script_options)
  # return unless script_options.config

  # Specifies an optional option argument
  parser.on("-c", "--create [COMMAND]", "alias.key 'your short command'", "Your config alias") do |message|
    script_options.config_message = message || ''
    script_options.config_type = 'create'
  end

  parser.on("-d", "--delete [COMMAND]", "alias.[key of command] eg: alias.ssh_10.10.10.10", "your key you want remove") do |message|
    script_options.config_message = message || ''
    script_options.config_type = 'delete'
  end

  parser.on("-l", "--list [COMMAND]", "alias.[key of command] eg: alias.ssh_10.10.10.10", "your key you want remove") do |message|
    script_options.config_message = message || ''
    script_options.config_type = 'list'
  end
end