forked from voxpupuli/hiera-eyaml
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunknown_command.rb
More file actions
43 lines (35 loc) · 1.05 KB
/
Copy pathunknown_command.rb
File metadata and controls
43 lines (35 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
require 'hiera/backend/eyaml/subcommand'
class Hiera
module Backend
module Eyaml
module Subcommands
class UnknownCommand < Eyaml::Subcommand
class << self
attr_accessor :original_command
end
@@original_command = 'unknown'
def self.options
[]
end
def self.description
"Unknown command (#{@@original_command})"
end
def self.execute
puts <<~EOS
Unknown subcommand#{': ' + Eyaml.subcommand if Eyaml.subcommand}
Usage: eyaml <subcommand>
Please use one of the following subcommands or help for more help:
#{Eyaml.subcommands.sort.collect do |command|
command_class = Subcommands.const_get(Utils.camelcase(command))
command unless command_class.hidden?
end.compact.join(', ')}
EOS
end
def self.hidden?
true
end
end
end
end
end
end