268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
|
# File 'lib/command_runner.rb', line 268
def run
return unless parse_args
if ARGV.length == 0
if @options[:version]
Installer.new.version
else
puts HELP
end
return
end
cmd = ARGV[0]
if @options[:help]
Help.new.run(cmd)
return
end
case cmd
when "help"; Help.new.run(ARGV[1])
when "install";
begin
Installer.new.install(@options)
ensure
system('stty echo')
end
when "uninstall"; Installer.new.uninstall
when "clear"; WebroarCommand.new.clear
when "start", "stop", "restart" ; WebroarCommand.new.operation(ARGV, cmd)
when "add" ; WebroarCommand.new.add(@options, ARGV)
when "remove" ; WebroarCommand.new.remove(ARGV)
when "test"; Installer.new.test(@options)
else
puts "ERROR: Invalid command: #{cmd}. See 'webroar help'."
end
end
|