diff options
author | Noah Kantrowitz <noah@coderanger.net> | 2018-07-10 18:47:18 -0700 |
---|---|---|
committer | Noah Kantrowitz <noah@coderanger.net> | 2018-07-10 18:47:18 -0700 |
commit | c78512254c655de1d66d0a300b5a7db4cd09adce (patch) | |
tree | 07017ad1aea4725bcc0c01ab309aa5415f87bceb /lib/chef/knife | |
parent | 41881272af33a831baec0c491565586cd5f1b77f (diff) | |
download | chef-c78512254c655de1d66d0a300b5a7db4cd09adce.tar.gz |
Add support for knife commands with hyphens.
This works exactly like with an underscore, but is a bit more user-friendly sometimes (e.g. `get_config` vs `get-config`).
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
Diffstat (limited to 'lib/chef/knife')
-rw-r--r-- | lib/chef/knife/core/subcommand_loader.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/knife/core/subcommand_loader.rb b/lib/chef/knife/core/subcommand_loader.rb index 146411a399..fb3723de50 100644 --- a/lib/chef/knife/core/subcommand_loader.rb +++ b/lib/chef/knife/core/subcommand_loader.rb @@ -142,7 +142,7 @@ class Chef words = words.dup match = nil until match || words.empty? - candidate = words.join(sep) + candidate = words.join(sep).tr("-", "_") if hash.key?(candidate) match = candidate else |