Object
# File lib/syckle/cli.rb, line 89 def application @application ||= Syckle::Application.new(self) end
# File lib/syckle/cli.rb, line 23 def initialize_options @options = { :trace=>nil, :trial=>nil, :debug=>nil, :quiet=>nil, :verbose=>nil, :force=>nil, :multitask=>nil, :skip=>[] } end
# File lib/syckle/cli.rb, line 32 def initialize_usage @usage = OptionParser.new do |usage| usage.banner = "Usage: syckle [<cycle>:]<phase> [options]" usage.on('--trace', "Run in TRACE mode.") do #$TRACE = true options[:trace] = true end usage.on('--trial', "Run in TRIAL mode (no disk writes).") do #$TRIAL = true options[:trial] =true end usage.on('--debug', "Run in DEBUG mode.") do $DEBUG = true $VERBOSE = true # wish this were called $WARN options[:debug] = true # DEPRECATE end usage.on('--verbose', "Provided extra output.") do options[:verbose] = true end usage.on('-q', '--quiet', "Run silently.") do options[:quiet] = true end usage.on('--force', "Force operations.") do options[:force] = true end usage.on('-m', '--multitask', "Run in parallel.") do options[:multitask] = true end usage.on('-s', '--skip [SERVICE]', 'Skip service.') do |s| options[:skip] << s end usage.on_tail('--help', "Display this help message.") do puts usage exit end usage.on_tail('--config', "Produce a configuration template.") do puts application.config_template.to_yaml exit end end end
# File lib/syckle/cli.rb, line 115 def method_missing(s, *a) s = s.to_s.chomp('?').to_sym if options.key?(s) options[s] else super end end
Generated with the Darkfish Rdoc Generator 2.