Method: Jets::Commands::Markdown::Page#options

Defined in:
lib/jets/commands/markdown/page.rb

#optionsObject



31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/jets/commands/markdown/page.rb', line 31

def options
  shell = Shell.new
  @cli_class.send(:class_options_help, shell, nil => @command.options.values)
  text = shell.stdout.string
  return "" if text.empty? # there are no options

  lines = text.split("\n")[1..-1] # remove first line wihth "Options: "
  lines.map! do |line|
    # remove 2 leading spaces
    line.sub(/^  /, '')
  end
  lines.join("\n")
end