lib/chef-dk/commands_map.rb in chef-dk-1.6.11 vs lib/chef-dk/commands_map.rb in chef-dk-2.0.26
- old
+ new
@@ -52,11 +52,11 @@
# end
#
class CommandsMap
NULL_ARG = Object.new
- CommandSpec = Struct.new(:name, :constant_name, :require_path, :description)
+ CommandSpec = Struct.new(:name, :constant_name, :require_path, :description, :hidden)
class CommandSpec
def instantiate
require require_path
@@ -70,15 +70,15 @@
def initialize
@command_specs = {}
end
- def builtin(name, constant_name, require_path: NULL_ARG, desc: "")
+ def builtin(name, constant_name, require_path: NULL_ARG, desc: "", hidden: false)
if null?(require_path)
snake_case_path = name.tr("-", "_")
require_path = "chef-dk/command/#{snake_case_path}"
end
- command_specs[name] = CommandSpec.new(name, constant_name, require_path, desc)
+ command_specs[name] = CommandSpec.new(name, constant_name, require_path, desc, hidden)
end
def instantiate(name)
spec_for(name).instantiate
end