Module: KubernetesHarness::CLI

Defined in:
lib/k8s_harness/cli.rb

Overview

This module contains everything CLI-related. We’re using it as the entry-point for k8s-harness.

Class Method Summary collapse

Class Method Details

.enable_debug_logging_if_presentObject



93
94
95
# File 'lib/k8s_harness/cli.rb', line 93

def self.enable_debug_logging_if_present
  KubernetesHarness::Logging.enable_debug_logging if @options[:base][:enable_debug_logging]
end

.parse(args) ⇒ Object



80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/k8s_harness/cli.rb', line 80

def self.parse(args)
  args.push('-h') if args.empty? || subcommands_missing?(args)
  @base_command.order!(args)
  subcommand = args.shift
  if subcommand.nil?
    puts @options[:base][:help]
  else
    enable_debug_logging_if_present
    @subcommands[subcommand.to_sym][:option_parser].order!(args)
    call_entrypoint(subcommand)
  end
end