Class: LoadRunner::CommandLine
- Inherits:
-
Object
- Object
- LoadRunner::CommandLine
- Includes:
- Colsole, Singleton
- Defined in:
- lib/load_runner/command_line.rb
Overview
Handles the command line interface
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
Instance Method Summary collapse
-
#execute(argv = []) ⇒ Object
Gets an array of arguments (e.g. ARGV), executes the command if valid and shows usage patterns / help otherwise.
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
12 13 14 |
# File 'lib/load_runner/command_line.rb', line 12 def args @args end |
Instance Method Details
#execute(argv = []) ⇒ Object
Gets an array of arguments (e.g. ARGV), executes the command if valid and shows usage patterns / help otherwise.
16 17 18 19 20 21 22 23 24 |
# File 'lib/load_runner/command_line.rb', line 16 def execute(argv=[]) doc = File.read File.dirname(__FILE__) + '/docopt.txt' begin @args = Docopt::docopt(doc, argv: argv, version: VERSION) handle rescue Docopt::Exit => e puts e. end end |