[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Max Martin max at puppetlabs.com
Tue May 10 08:16:15 UTC 2011


The following commit has been merged in the experimental branch:
commit b142973a94ced6c0ff43da882189abe806c18c68
Merge: 977684ee83627194c78c81e30c001f3d9062f6f3 13e64fe9d72a0207ff65a35242d855cd3c55dd43
Author: Max Martin <max at puppetlabs.com>
Date:   Mon Apr 18 11:44:29 2011 -0700

    Merge branch 'ticket/2.7.x/7131-optional-arguments' into 2.7.x
    
    * ticket/2.7.x/7131-optional-arguments:
      (#7131) Remove support for optional arguments to options

diff --combined lib/puppet/interface/option.rb
index ab18261,5c75ffd..1971926
--- a/lib/puppet/interface/option.rb
+++ b/lib/puppet/interface/option.rb
@@@ -1,3 -1,5 +1,3 @@@
 -require 'puppet/interface'
 -
  class Puppet::Interface::Option
    def initialize(parent, *declaration, &block)
      @parent   = parent
@@@ -43,8 -45,9 +43,9 @@@
  
      # Is our argument optional?  The rules about consistency apply here, also,
      # just like they do to taking arguments at all. --daniel 2011-03-30
-     @optional_argument = @optparse.any? { |o| o.include? "[" }
-     if @optional_argument and not @optparse.all? { |o| o.include? "[" } then
+     @optional_argument = @optparse.any? { |o| o=~/[ =]\[/ }
+     @optional_argument and raise ArgumentError, "Options with optional arguments are not supported"
+     if @optional_argument and not @optparse.all? { |o| o=~/[ =]\[/ } then
        raise ArgumentError, "Option #{@name} is inconsistent about the argument being optional"
      end
    end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list