Class: Qc::CLI

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

Instance Method Summary collapse

Constructor Details

#initializeCLI

Returns a new instance of CLI.



3
4
# File 'lib/qc/cli.rb', line 3

def initialize
end

Instance Method Details

#run(argv) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/qc/cli.rb', line 6

def run(argv)
  parsed_options = parse_options(argv)

  command = argv[0]
  client = Qc::CommandRunner.new(quant_connect_proxy, parsed_options)
  success = begin
    if command
      client.run(command.to_sym)
    else
      client.run_default
    end
  rescue StandardError => error
    puts "Error: #{error}"
    false
  end

  success
end