4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/convoy/auto_options.rb', line 4
def augment(setup)
if setup.has_config_file?
setup.add_global_option :config, "Configuration file to use for this execution", :short => :none, :long => '--config', :type => :string
setup.add_global_command :convoy, :aliases => [] do |command|
command.summary "Auto created utility command"
command.description "Auto created utility command"
command.requires_arguments false
command.options do |opts|
opts.opt :create_config, "Create configuration file at specified location", :short => :none, :long => '--create-config', :type => :string
opts.opt :create_default_config, "Create a default configuration file", :short => :none, :long => '--create-default-config', :type => :boolean, :default => false
opts.opt :update_config, "Update configuration file at specified location", :short => :none, :long => '--update-config', :type => :string
opts.opt :update_default_config, "Update the default configuration file", :short => :none, :long => '--update-default-config', :type => :boolean, :default => false
opts.conflict :create_config, :create_default_config, :update_config, :update_default_config
end
command.action do |options, arguments|
ActionCommand::ConvoyUtilityCommand.new(setup, options, arguments).execute
end
end
end
setup.add_global_option :verbosity, 'Verbosity level of output for current execution (e.g. INFO, DEBUG)', :short => :none, :long => '--verbosity', :type => :string, :default => 'WARN'
setup.add_global_option :error_output_format, 'The format to use when outputting errors (e.g. basic, advanced)', :short => :none, :long => '--error-output-format', :type => :string, :default => 'basic'
end
|