Class: TTY::CLI
Overview
Main CLI runner
Constant Summary collapse
- Error =
Error raised by this runner
Class.new(StandardError)
Constants included from Licenses
Licenses::CUSTOM, Licenses::LICENSES
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Licenses
Class Method Details
.help ⇒ Object
46 47 48 49 |
# File 'lib/tty/cli.rb', line 46 def self.help(*) puts super end |
Instance Method Details
#add(*names) ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/tty/cli.rb', line 79 def add(*names) if [:help] invoke :help, ['add'] elsif names.size < 1 fail Error, "'teletype add' was called with no arguments\n" \ "Usage: 'teletype add COMMAND_NAME'" else require_relative 'commands/add' TTY::Commands::Add.new(names, ).execute end end |
#new(app_name = nil) ⇒ Object
120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/tty/cli.rb', line 120 def new(app_name = nil) if [:help] invoke :help, ['new'] elsif app_name.nil? fail Error, "'teletype new' was called with no arguments\n" \ "Usage: 'teletype new PROJECT_NAME'" else require_relative 'commands/new' TTY::Commands::New.new(app_name, ).execute end end |