Class: LairClient::Program

Inherits:
Commander::Runner
  • Object
show all
Includes:
Commander::UI, Commander::UI::AskForClass
Defined in:
lib/lair_client/program.rb

Constant Summary collapse

GLOBAL_OPTIONS =
[ :config, :verbose ]
BACKTRACE_NOTICE =
' (use --trace to view backtrace)'

Instance Method Summary collapse

Constructor Details

#initialize(argv = ARGV) ⇒ Program

Returns a new instance of Program.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/lair_client/program.rb', line 12

def initialize argv = ARGV
  super argv

  program :name, 'lair'
  program :version, LairClient::VERSION
  program :description, 'Lair client.'

  global_option '-c', '--config PATH', 'Use a custom configuration file (defaults to ~/.lair.yml)'
  global_option '--verbose', 'Increase verbosity'

  command :scan do |c|
    c.syntax = 'lair scan'
    c.description = 'Scan files'
    c.action do |args,options|
      to_trace_or_not_to_trace options.trace do
        cli.scan *args, extract(options)
      end
    end
  end
end