Class: Inprovise::Cli
- Inherits:
-
Object
- Object
- Inprovise::Cli
- Extended by:
- GLI::App
- Defined in:
- lib/inprovise/cli/node.rb,
lib/inprovise/cli.rb,
lib/inprovise/cli/group.rb,
lib/inprovise/cli/provision.rb
Overview
CLI provisioning commands for Inprovise
- Author
-
Martin Corino
- License
-
Distributes under the same license as Ruby
Class Method Summary collapse
- .setup_provisioning_cmd(cmd, with_force = true, &block) ⇒ Object
- .show_target(tgt, details = false) ⇒ Object
Class Method Details
.setup_provisioning_cmd(cmd, with_force = true, &block) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/inprovise/cli/provision.rb', line 8 def self.setup_provisioning_cmd(cmd, with_force=true, &block) cmd.desc 'Path to a provisioning scheme to load' cmd.flag [:s,:scheme], :arg_name => 'FILE', :multiple => true, :default_value => Inprovise.default_scheme cmd.flag [:c, :config], :arg_name => 'CFGKEY=CFGVAL', :multiple => true, :desc => 'Specify a configuration setting for the script execution' cmd.switch [:f, :force], negatable: false, :desc => 'Force command to run without verifying validity.' if with_force cmd.action(&block) end |
.show_target(tgt, details = false) ⇒ Object
100 101 102 103 104 105 |
# File 'lib/inprovise/cli.rb', line 100 def self.show_target(tgt, details=false) $stdout.puts " #{tgt}" if details $stdout.puts " \t"+JSON.pretty_generate(tgt.config).split("\n").join("\n \t") end end |