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/base.rb,
lib/dapp/cli/list.rb,
lib/dapp/cli/push.rb,
lib/dapp/cli/build.rb,
lib/dapp/cli/flush.rb,
lib/dapp/cli/smartpush.rb,
lib/dapp/cli/flush/build_cache.rb,
lib/dapp/cli/flush/stage_cache.rb

Overview

CLI

Defined Under Namespace

Classes: Base, Build, Flush, List, Push, Smartpush

Constant Summary collapse

SUBCOMMANDS =
%w(build smartpush push list flush).freeze

Instance Method Summary collapse

Methods included from Helper::Cli

composite_options, parse_options, parse_subcommand, prepare_subcommand, required_argument, run_subcommand

Methods included from Helper::Trivia

class_to_lowercase, #class_to_lowercase, #delete_file, #kwargs, #to_mb

Constructor Details

#initialize(*args) ⇒ CLI

Returns a new instance of CLI.



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

def initialize(*args)
  super(*args)

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

Instance Method Details

#run(argv = ARGV) ⇒ Object



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

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