Class: Brigit::CLI
- Inherits:
-
Object
- Object
- Brigit::CLI
- Defined in:
- lib/brigit/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.banner ⇒ Object
15 16 17 |
# File 'lib/brigit/cli.rb', line 15 def self. %{Brigit (v#{Version::STRING}) Submodule utilities for Git} end |
.usage ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/brigit/cli.rb', line 19 def self.usage lines = [ , %{COMMANDS: (`COMMAND --help' for documentation)}, *Command.list.map { |cmd| " #{cmd.name}" }.sort ] lines.join "\n" end |
Instance Method Details
#parse(*args) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/brigit/cli.rb', line 7 def parse(*args) if !args.empty? && (command = Command[args.shift]) command.new(*args) else abort "No command given.\n\n#{self.class.usage}" end end |