Top Level Namespace
Defined Under Namespace
Modules: YoreCore Classes: AWSS3Client, BufferedLogger, Class
Constant Summary collapse
- THIS_FILE =
File.(__FILE__)
- THIS_DIR =
File.dirname(THIS_FILE)
- CMD_OPTIONS =
options given on command line
{}
Instance Method Summary collapse
-
#command(aParser, aController, aAction, aShortDescription = nil, aOptionParser = nil, aOther = {}) ⇒ Object
this contains a block that actually creates the controller, yore.
Instance Method Details
#command(aParser, aController, aAction, aShortDescription = nil, aOptionParser = nil, aOther = {}) ⇒ Object
this contains a block that actually creates the controller, yore
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'bin/yore', line 16 def command(aParser,aController,aAction,aShortDescription=nil,aOptionParser=nil,aOther={}) c = CmdParse::Command.new( aAction.to_s, false ) c.short_desc = aShortDescription c.description = aOther[:description] if aOther[:description] c. = aOptionParser if aOptionParser c.set_execution_block do |args| CMD_OPTIONS[:config] = args.first if aAction == :backup CMD_OPTIONS[:config] = 'yore.config.xml' if !CMD_OPTIONS[:config] && File.exists?('yore.config.xml') aController.configure(CMD_OPTIONS[:config],CMD_OPTIONS) unless CMD_OPTIONS.empty? aController.do_action(aAction,args) end aParser.add_command(c) end |