Module: Jenkins::CLI::Formatting::ClassMethods
- Defined in:
- lib/jenkins/cli/formatting.rb
Instance Method Summary collapse
Instance Method Details
#print_options(shell, options, grp = nil) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/jenkins/cli/formatting.rb', line 20 def (shell, , grp = nil) return if .empty? table = .map do |option| prototype = if option.default " [#{option.default}]" elsif option.boolean? "" elsif option.required? " #{option.}" else " [#{option.}]" end aliases = option.aliases.empty? ? "" : option.aliases.join(" ") + "," [aliases, "--#{option.name}#{prototype}", "\t",option.description] end shell.print_table(table, :ident => 2) shell.say end |
#task_help(shell, task_name) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/jenkins/cli/formatting.rb', line 7 def task_help(shell, task_name) meth = normalize_task_name(task_name) task = all_tasks[meth] handle_no_task_error(meth) unless task shell.say "usage: #{(task)}" shell.say (shell, nil => task..map { |_, o| o }) # shell.say task.description # shell.say end |