Method: Jets::Thor::Help::ClassMethods#help_main

Defined in:
lib/jets/thor/help.rb

#help_main(shell, subcommand = false) ⇒ Object



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/jets/thor/help.rb', line 81

def help_main(shell, subcommand = false)
  list = command_list(subcommand)

  filter = proc do |command, desc|
    main_commands.detect { |name| command =~ Regexp.new("^jets #{name}") }
  end
  main = list.select(&filter)
  other = list.reject(&filter)

  shell.say "Usage: jets COMMAND [args]"
  shell.say "\nMain Commands:\n\n"
  shell.print_table(main, indent: 2, truncate: true)
  shell.say "\nOther Commands:\n\n"
  shell.print_table(other, indent: 2, truncate: true)
  shell.say "\n    For more help on each command, you can use the -h option. Example:\n\n      jets deploy -h\n\n    CLI Reference also available at: https://docs.rubyonjets.com/reference/\n  EOL\nend\n"