Module: Envo::Cli::Runner::Opts
Constant Summary collapse
Instance Method Summary collapse
Instance Method Details
#parse_cli(opt) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/envo/cli/runner.rb', line 17 def parse_cli(opt) case opt when '--force', '-f' then return {interact: :force} when '--no-force', '-nf' then return {interact: :noforce} when '--interactive' then return {interact: :interact} when '--raw', '-r' then return {raw: true} else raise Envo::Error.new "unknown command line option: #{opt}" end end |
#print_arg(log, arg, text) ⇒ Object
26 27 28 |
# File 'lib/envo/cli/runner.rb', line 26 def print_arg(log, arg, text) log.puts " #{arg.ljust(15)} - #{text}" end |
#print_help(log) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/envo/cli/runner.rb', line 29 def print_help(log) print_arg log, '--force, -f', 'force the execution of the command disregarding checks' print_arg log, '--interactive', '(default) ask a question when a check fails' print_arg log, '--no-force, -nf', 'produce an error instead of asking questions for checks' print_arg log, '--raw, -r', 'don\'t infer types and treat each value as a raw string' end |