Method: YARD::CLI::CommandParser#run

Defined in:
lib/yard/cli/command_parser.rb

#run(*args) ⇒ void

This method returns an undefined value.

Runs the YARD::CLI::Command object matching the command name of the first argument.


59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/yard/cli/command_parser.rb', line 59

def run(*args)
  unless args == ['--help']
    if args.size == 0 || args.first =~ /^-/
      command_name = self.class.default_command
    else
      command_name = args.first.to_sym
      args.shift
    end
    if commands.has_key?(command_name)
      return commands[command_name].run(*args)
    end
  end
  list_commands
end