Class: DTK::Client::CommandBaseOptionParser
- Inherits:
-
Object
- Object
- DTK::Client::CommandBaseOptionParser
- Extended by:
- Auxiliary
- Includes:
- CommandBase
- Defined in:
- lib/parser/adapters/option_parser.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(conn) ⇒ CommandBaseOptionParser
constructor
A new instance of CommandBaseOptionParser.
Methods included from Auxiliary
Methods included from CommandBase
#get, #get_connection, handle_argument_error, #post, #post_file, #rest_url, #rotate_args
Constructor Details
#initialize(conn) ⇒ CommandBaseOptionParser
Returns a new instance of CommandBaseOptionParser.
23 24 25 |
# File 'lib/parser/adapters/option_parser.rb', line 23 def initialize(conn) @conn = conn end |
Class Method Details
.command_name ⇒ Object
36 37 38 |
# File 'lib/parser/adapters/option_parser.rb', line 36 def command_name() snake_form(self,"-") end |
.execute_from_cli(conn, argv, shell_execute = false) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/parser/adapters/option_parser.rb', line 27 def self.execute_from_cli(conn,argv,shell_execute=false) return conn.connection_error if conn.connection_error method, args_hash = OptionParser.(self,argv) instance = new(conn) raise Error.new("Illegal subcommand #{method}") unless instance.respond_to?(method) instance.send(method,args_hash) end |