Class: Netscaler::CLI

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

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ CLI

Returns a new instance of CLI.



13
14
15
# File 'lib/netscaler/cli.rb', line 13

def initialize(args)
  @args = args.dup
end

Instance Method Details

#execute!Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/netscaler/cli.rb', line 21

def execute!
  begin
    command.execute!(@args)
  rescue SystemExit
    raise
  rescue Netscaler::ConfigurationError => e
    print_error(e.message)
    exit 1
  rescue Exception => e
    STDERR.puts e.backtrace
    print_error(e.message)
    exit 1
  end
end

#parse!(propagate = nil) ⇒ Object



17
18
19
# File 'lib/netscaler/cli.rb', line 17

def parse!(propagate=nil)
  command.parse!(@args, propagate)
end