Class: Formatron::CLI

Inherits:
Object
  • Object
show all
Includes:
Commander::Methods
Defined in:
lib/formatron/cli.rb,
lib/formatron/cli/deploy.rb,
lib/formatron/cli/destroy.rb,
lib/formatron/cli/provision.rb,
lib/formatron/cli/completion.rb,
lib/formatron/cli/generators/guid.rb,
lib/formatron/cli/generators/instance.rb,
lib/formatron/cli/generators/bootstrap.rb,
lib/formatron/cli/generators/credentials.rb,
lib/formatron/cli/generators/databag_secret.rb

Overview

CLI interface

Defined Under Namespace

Modules: Completion, Deploy, Destroy, Generators, Provision

Instance Method Summary collapse

Instance Method Details

#commandsObject



19
20
21
22
23
# File 'lib/formatron/cli.rb', line 19

def commands
  self.class.instance_methods.each do |method|
    send(method) if method =~ /_formatron_command$/
  end
end

#global_optionsObject



9
10
11
12
13
14
15
16
17
# File 'lib/formatron/cli.rb', line 9

def global_options
  global_option '-y', '--yes', 'Automatic yes to prompts'
  global_option '-c', '--credentials FILE', 'The credentials file'
  global_option(
    '-d',
    '--directory DIRECTORY',
    'The Formatron configuration directory'
  )
end

#runObject



25
26
27
28
29
30
31
32
# File 'lib/formatron/cli.rb', line 25

def run
  program :version, Formatron::VERSION
  program :description, 'Quickly deploy AWS CloudFormation ' \
                        'stacks backed by a Chef Server'
  global_options
  commands
  run!
end