Class: YARD::CLI::LinkStdlib::Help
- Inherits:
-
Command
- Object
- Command
- YARD::CLI::LinkStdlib::Help
- Includes:
- CommandHelper
- Defined in:
- lib/yard/cli/link_stdlib/help.rb
Overview
Definitions
Constant Summary collapse
- USAGE =
"yard stdlib help [OTHER_OPTIONS]"- DESCRIPTION =
"Show this message"
Instance Method Summary collapse
Methods included from CommandHelper
#add_header, #add_version_opt, #check_args!, #description, #opts, #usage
Instance Method Details
#run(*args) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/yard/cli/link_stdlib/help.rb', line 39 def run *args OptionParser.new { |op| add_header op }.parse! args commands = LinkStdlib.commands log.puts " yard-link_stdlib provides linking to online Ruby docs for standard \n library code objects.\n \n Usage:\n \n yard stdlib COMMAND... [OPTIONS] [ARGS]\n \n Commands:\n \n END\n commands.keys.sort_by(&:to_s).each do |command_name|\n command_class = commands[command_name]\n next unless command_class < Command\n command = command_class.new\n log.puts \"%-8s %s\" % [command_name, command.description]\n end\n log.puts\nend\n" |