Module: Minfra::Cli

Extended by:
Logging
Includes:
Hook
Defined in:
lib/minfra/cli.rb,
lib/minfra/cli/ask.rb,
lib/minfra/cli/env.rb,
lib/minfra/cli/hook.rb,
lib/minfra/cli/common.rb,
lib/minfra/cli/config.rb,
lib/minfra/cli/errors.rb,
lib/minfra/cli/plugin.rb,
lib/minfra/cli/runner.rb,
lib/minfra/cli/command.rb,
lib/minfra/cli/logging.rb,
lib/minfra/cli/plugins.rb,
lib/minfra/cli/version.rb,
lib/minfra/cli/templater.rb,
lib/minfra/cli/cli_starter.rb,
lib/minfra/cli/helm_runner.rb,
lib/minfra/cli/commands/dev.rb,
lib/minfra/cli/commands/tag.rb,
lib/minfra/cli/hiera_looker.rb,
lib/minfra/cli/main_command.rb,
lib/minfra/cli/commands/kube.rb,
lib/minfra/cli/commands/setup.rb,
lib/minfra/cli/commands/stack.rb,
lib/minfra/cli/kubectl_runner.rb,
lib/minfra/cli/commands/plugin.rb,
lib/minfra/cli/commands/project.rb,
lib/minfra/cli/commands/project/tag.rb,
lib/minfra/cli/commands/project/branch.rb,
lib/minfra/cli/commands/stack/app_template.rb,
lib/minfra/cli/commands/stack/client_template.rb,
lib/minfra/cli/commands/stack/kube_stack_template.rb

Defined Under Namespace

Modules: Ask, Common, Errors, Hook, Logging, StackM Classes: CliStarter, Command, Config, Dev, Env, HelmRunner, HieraLooker, Kube, KubeCtlRunner, Main, Plugin, Plugins, Project, Runner, Setup, Stack, Tag, Templater

Constant Summary collapse

VERSION =
'4.6.0'

Class Method Summary collapse

Methods included from Logging

debug, deprecated, error, exit_error, info, warn

Methods included from Hook

included

Class Method Details

.exec(argv) ⇒ Object



53
54
55
56
57
58
# File 'lib/minfra/cli.rb', line 53

def self.exec(argv)
 
  init(argv) unless init?
  cli.install
  cli.run
end

.init(argv = []) ⇒ Object



48
49
50
51
# File 'lib/minfra/cli.rb', line 48

def self.init(argv = [])
  self.subcommands ||= {}
  self.cli = CliStarter.new(argv)
end

.init?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/minfra/cli.rb', line 44

def self.init?
  !!cli
end

.register(subcommand, info, command) ⇒ Object



60
61
62
# File 'lib/minfra/cli.rb', line 60

def self.register(subcommand, info, command)
  self.subcommands[subcommand.to_sym] = OpenStruct.new(name: subcommand, info:, command:)
end