Class: Kontena::MainCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/kontena/main_command.rb

Instance Attribute Summary

Attributes inherited from Command

#arguments, #exit_code, #result

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

banner, callback_matcher, #help_requested?, inherited, #instance, load_subcommand, requires_current_account_token, requires_current_account_token?, requires_current_grid, requires_current_grid?, requires_current_master, requires_current_master?, requires_current_master_token, requires_current_master_token?, #run, #run_callbacks, #verify_current_account_token, #verify_current_grid, #verify_current_master, #verify_current_master_token

Class Method Details

.register(command, description, command_class) ⇒ Object

Parameters:



42
43
44
# File 'lib/kontena/main_command.rb', line 42

def self.register(command, description, command_class)
  subcommand(command, description, command_class)
end

Instance Method Details

#executeObject



36
37
# File 'lib/kontena/main_command.rb', line 36

def execute
end

#known_plugin_subcommand?(name) ⇒ Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/kontena/main_command.rb', line 63

def known_plugin_subcommand?(name)
  ['vagrant', 'packet', 'digitalocean', 'azure', 'upcloud', 'aws', 'shell'].include?(name)
end

#subcommand_missing(name) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/kontena/main_command.rb', line 46

def subcommand_missing(name)
  extend Kontena::Cli::Common
  if known_plugin_subcommand?(name)
    exit_with_error "The '#{name}' plugin has not been installed. Use: kontena plugin install #{name}"
  elsif name == 'login'
    exit_with_error "Use 'kontena master login' to log into a Kontena Master\n"+
           "         or 'kontena cloud login' for logging into your Kontena Cloud account"
  elsif name == 'logout'
    exit_with_error "Use 'kontena master logout' to log out from a Kontena Master\n"+
           "         or 'kontena cloud logout' for logging out from your Kontena Cloud account"
  elsif name == 'app'
    exit_with_error "The deprecated app subcommand has been moved into a plugin. You can install\n" +
           "         it by using 'kontena plugin install app-command'"
  end
  super
end