Class: Enviera::Subcommands::UnknownCommand

Inherits:
Enviera::Subcommand show all
Defined in:
lib/enviera/subcommands/unknown_command.rb

Constant Summary collapse

@@original_command =
"unknown"

Class Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Enviera::Subcommand

all_options, attach_option, find, load_config_file, parse, prettyname, validate

Class Attribute Details

.original_commandObject

Returns the value of attribute original_command.



9
10
11
# File 'lib/enviera/subcommands/unknown_command.rb', line 9

def original_command
  @original_command
end

Class Method Details

.descriptionObject



18
19
20
# File 'lib/enviera/subcommands/unknown_command.rb', line 18

def self.description
  "Unknown command (#{@@original_command})"
end

.executeObject



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/enviera/subcommands/unknown_command.rb', line 22

def self.execute
  subcommands = Enviera.subcommands
  puts <<-EOS
Unknown subcommand#{ ": " + Enviera.subcommand if Enviera.subcommand }
Usage: enviera <subcommand>
Please use one of the following subcommands or help for more help:
  #{Enviera.subcommands.sort.collect {|command|
  command_class = Subcommands.const_get(Utils.camelcase command)
  command unless command_class.hidden?
}.compact.join(", ")}
EOS
end

.hidden?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/enviera/subcommands/unknown_command.rb', line 35

def self.hidden?
  true
end

.optionsObject



14
15
16
# File 'lib/enviera/subcommands/unknown_command.rb', line 14

def self.options
  []
end