summaryrefslogtreecommitdiffstats
path: root/lib/puppet/interface
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/interface')
-rw-r--r--lib/puppet/interface/action.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/puppet/interface/action.rb b/lib/puppet/interface/action.rb
index 9c9741b52..b842c2831 100644
--- a/lib/puppet/interface/action.rb
+++ b/lib/puppet/interface/action.rb
@@ -255,6 +255,20 @@ WRAPPER
end
def validate_args(args)
+ # Check for multiple aliases for the same option...
+ args.last.keys.each do |name|
+ # #7290: If this isn't actually an option, ignore it for now. We should
+ # probably fail, but that wasn't our API, and I don't want to perturb
+ # behaviour this late in the RC cycle. --daniel 2011-04-29
+ if option = get_option(name) then
+ overlap = (option.aliases & args.last.keys)
+ unless overlap.length == 1 then
+ raise ArgumentError, "Multiple aliases for the same option passed: #{overlap.join(', ')}"
+ end
+ end
+ end
+
+ # Check for missing mandatory options.
required = options.map do |name|
get_option(name)
end.select(&:required?).collect(&:name) - args.last.keys