Class: Oncall::Commands::BaseCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/oncall/commands/base_command.rb

Class Method Summary collapse

Class Method Details

.invoke(args) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/oncall/commands/base_command.rb', line 6

def self.invoke(args)
  OptionParser.new do |opts|
    opts.banner = 'Usage: oncall'
    opts.separator ''
    opts.separator 'Options:'

    opts.on('--version', 'Show version information.') do
      puts "oncall: version #{Oncall::VERSION}"
      exit
    end

    opts.on('--help', 'Display this help message.') do
      puts opts
      exit
    end

    puts opts
    exit
  end.parse!
end