From b82f29c61aa84a12fc208487e4b049cb24702261 Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Wed, 13 Jul 2011 15:38:32 -0700 Subject: (#7699) Help command should only list options once The problem was caused by the fact that the options method returns a list of options that treated the aliases as seperate options. The fix is to only maintain a list of options and not add all aliases to the options list. --- spec/unit/interface/action_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'spec/unit/interface') diff --git a/spec/unit/interface/action_spec.rb b/spec/unit/interface/action_spec.rb index cf8d61d51..23216e7b4 100755 --- a/spec/unit/interface/action_spec.rb +++ b/spec/unit/interface/action_spec.rb @@ -171,6 +171,16 @@ describe Puppet::Interface::Action do face.get_action(:foo).options.should =~ [:bar] end + it "should only list options and not aliases" do + face = Puppet::Interface.new(:action_level_options, '0.0.1') do + action :foo do + when_invoked do |options| true end + option "--bar", "-b", "--foo-bar" + end + end + face.get_action(:foo).options.should =~ [:bar] + end + describe "with both face and action options" do let :face do Puppet::Interface.new(:action_level_options, '0.0.1') do -- cgit