Class: TTY::CLI
Overview
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
license_identifiers, licenses
Class Method Details
.help ⇒ Object
47
48
49
50
|
# File 'lib/tty/cli.rb', line 47
def self.help(*)
puts top_banner
super
end
|
Instance Method Details
#add(*names) ⇒ Object
80
81
82
83
84
85
86
87
88
89
90
|
# File 'lib/tty/cli.rb', line 80
def add(*names)
if options[: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, options).execute
end
end
|
#new(app_name = nil) ⇒ Object
121
122
123
124
125
126
127
128
129
130
131
|
# File 'lib/tty/cli.rb', line 121
def new(app_name = nil)
if options[: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, options).execute
end
end
|
#version ⇒ Object
134
135
136
137
|
# File 'lib/tty/cli.rb', line 134
def version
require_relative 'version'
puts "v#{TTY::VERSION}"
end
|