Module: Runbook::CLIBase

Included in:
CLI, Generator
Defined in:
lib/runbook/cli_base.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/runbook/cli_base.rb', line 2

def self.included(base)
  base.extend(ClassMethods)

  base.check_unknown_options!

  base.class_option(
    :config,
    aliases: "-c",
    type: :string,
    group: :base,
    desc: "Path to runbook config file"
  )
end

Instance Method Details

#initialize(args = [], local_options = {}, config = {}) ⇒ Object



16
17
18
19
20
21
# File 'lib/runbook/cli_base.rb', line 16

def initialize(args = [], local_options = {}, config = {})
  super(args, local_options, config)

  cmd_name = config[:current_command].name
  _set_cli_config(options[:config], cmd_name) if options[:config]
end