Class: Nuke::Client::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/nuke/client/cli.rb

Class Method Summary collapse

Class Method Details

.run(args) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/nuke/client/cli.rb', line 7

def self.run args
  OptionParser.new do |parser|
    parser.banner = <<-Banner.gsub(/^\s+\|/,'')
      |Usage:
      |  nuker push <url>/projects/<project-name> <features-dir>
      |  nuker destroy <url>/projects/<project-name>
    Banner
  end.parse(args)

  command, url, *features = ARGV

  case command
    when "push"    then Command.new(url).push Parser.parse(features)
    when "destroy" then Command.new(url).destroy
  else
   abort "Please use --help for a listing of valid options"
  end
rescue Nuke::FeatureParseException
  puts "Couldn't parse features."
end