class Webgen::CLI::ShowConfigCommand

The CLI command for showing all available options.

Private Instance Methods

format_config_option(name, data, cur_val, meta_info) click to toggle source
# File lib/webgen/cli/commands/show_config.rb, line 58
def format_config_option(name, data, cur_val, meta_info)
  print("#{Utils.light(Utils.blue(name))}: ")
  if cur_val != data.default
    puts(Utils.green(cur_val.to_s) + " (default: #{data.default})")
  else
    puts(cur_val.inspect)
  end

  puts(Utils.format(meta_info['summary'], 78, 2, true).join("\n") + "\n\n") if @show_description
  if @show_syntax
    puts(Utils.format("Syntax:", 78, 2, true).join("\n"))
    puts(Utils.format(meta_info['syntax'], 78, 4, true).join("\n") + "\n\n")
  end
  if @show_examples
    meta_info['example'].each do |n,v|
      puts(Utils.format("Example for usage in #{n}:", 78, 2, true).join("\n"))
      puts(Utils.format(v, 78, 4, true).join("\n") + "\n\n")
    end
  end
end