Class: Command

Inherits:
PangeaCommand show all
Defined in:
lib/pangea/cli/subcommands/main.rb

Overview

cli entrypoint

Instance Method Summary collapse

Instance Method Details

#helpObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/pangea/cli/subcommands/main.rb', line 21

def help
  "    Usage: pangea command [OPTIONS] SUBCOMMAND\n\n    Arguments:\n      SUBCOMMAND  subcommand for pangea\n\n    Options:\n      -h, --help     Print usage\n      -v, --version  Print version\n\n    Subcommands:\n      infra   manage infrastructure\n      config  manage configuration\n  HELP\nend\n"

#runObject



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/pangea/cli/subcommands/main.rb', line 38

def run
  argv = ARGV
  parse(argv)

  case params[:subcommand].to_s
  when %(infra)
    InfraCommand.new.run(argv)
  when %(config)
    ConfigCommand.new.run(argv)
  else
    if params[:version]
      puts Pangea::VERSION
    else
      puts help
    end
    exit
  end
end