Class: Dapp::CLI

Inherits:
Object
  • Object
show all
Extended by:
Helper::Cli
Includes:
Helper::Trivia, Mixlib::CLI
Defined in:
lib/dapp/cli.rb,
lib/dapp/cli/command/base.rb,
lib/dapp/cli/command/update.rb

Defined Under Namespace

Modules: Command

Constant Summary collapse

SUBCOMMANDS =
['dimg', 'deployment', 'kube', 'update'].freeze

Class Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper::Cli

cli_wrapper, composite_options, in_validate!, list_msg_format, parse_options, parse_subcommand, prepare_subcommand, required_argument, run_subcommand

Methods included from Helper::Trivia

class_to_lowercase, #class_to_lowercase, #delete_file, #kwargs, #make_path, #search_file_upward

Constructor Details

#initialize(*args) ⇒ CLI

Returns a new instance of CLI.



44
45
46
47
48
49
# File 'lib/dapp/cli.rb', line 44

def initialize(*args)
  super(*args)

  opt_parser.program_name = 'dapp'
  opt_parser.version = ::Dapp::VERSION
end

Class Attribute Details

.dapp_objectObject

Returns the value of attribute dapp_object.



41
42
43
# File 'lib/dapp/cli.rb', line 41

def dapp_object
  @dapp_object
end

Instance Method Details

#run(argv = ARGV) ⇒ Object



51
52
53
54
55
# File 'lib/dapp/cli.rb', line 51

def run(argv = ARGV)
  argv, subcommand, subcommand_argv = self.class.parse_subcommand(self, argv)
  self.class.parse_options(self, argv)
  self.class.run_subcommand self, subcommand, subcommand_argv
end