Class: EY::Enzyme::OldCLI

Inherits:
Object
  • Object
show all
Defined in:
lib/ey_enzyme/old_cli.rb

Class Method Summary collapse

Class Method Details

.run(args) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ey_enzyme/old_cli.rb', line 3

def self.run(args)
  new_args = []

  opts = OptionParser.new do |opts|
    opts.version = "0.0.1"

    opts.banner = "Usage: ey-recipes[-flag] [argument]"
    opts.define_head "ey-recipes: running recipes..."
    opts.separator '*'*80

    opts.on("-c CONFIG", "--config CONFIG", "Use config file") do |config|
      # NO-OP
    end

    opts.on("--deploy-main ENV", "Run main recipes") do |env_name|
      new_args << "--main"
    end

    opts.on("-d ENV", "--deploy ENV", "Run custom recipes") do |env_name|
      new_args << "--custom"
    end
  end

  opts.parse!(args)

  if new_args.any?
    CLI.run(new_args)
  else
    $stderr.puts opts
  end
end