module Redmine::Command::InstanceMethods
Special instance methods for Command
objects that define a common interface:
Public Instance Methods
call(arguments)
click to toggle source
Override call
to provide your custom logic for a command object. The call
in this module will be prepended to call
in your own objects, ensuring that when invoked, all options will first be parsed. All non-recognized options will be passed as-is to the original call
method.
Calls superclass method
# File lib/redmine/command.rb, line 67 def call(arguments) OptionParser.new do |o| o.banner = 'Usage: ' + self.class.usage_description o.separator '' instance_exec o, &self.class.usage_options o.on_tail '-h', '--help', 'Show this message' do puts o exit end end.parse!(arguments) super(arguments) end
options()
click to toggle source
An generic options
hash that can be used to store preferences in from command line options, available in both the usage block and the call
method.
# File lib/redmine/command.rb, line 58 def options @otions ||= {} end