Class: QAT::CLI::Main
Overview
Main class for the CLI.
Instance Method Summary collapse
-
#execute! ⇒ Object
Main entry point for execution.
-
#initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel) ⇒ Main
constructor
Initialization from command line.
Methods included from Generator
#add_module, #add_modules, #create_project
Constructor Details
#initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel) ⇒ Main
Initialization from command line
14 15 16 17 18 19 |
# File 'lib/qat/cli/main.rb', line 14 def initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel) @argv, @stdin, @stdout, @stderr, @kernel = argv, stdin, stdout, stderr, kernel @options = {} @sub_options = {} @exit_code = 0 end |
Instance Method Details
#execute! ⇒ Object
Main entry point for execution
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/qat/cli/main.rb', line 22 def execute! parse_argv! if @options.any? rescue ArgumentError, OptionParser::MissingArgument => exception @stderr.puts "Error: #{exception.}" @exit_code = 1 ensure @kernel.exit(exit_code) end |