Issue #2420 has been updated by Brice Figureau.

Status changed from Needs more information to Needs design decision
Assigned to changed from Brice Figureau to Luke Kanies
Complexity changed from Unknown to Easy
Keywords set to options daemonize

Brice Figureau wrote:
> James Turnbull wrote:
> > See this code block in application.rb:
> > 
> > [...]
> > 
> > Brice - not sure if I am understanding this correctly but wouldn't this 
> > ignore any short options?
> 
> Actually, I don't think so. This code block uses the long option to name a 
> method we create to manage the option if it is given on the command-line. The 
> full options (short and long) are passed to the ruby OptionParser. 
> I'll debug this tonight.

As I said in puppet-dev 
(http://groups.google.com/group/puppet-dev/msg/dff69ebe7efdbc10), I don't think 
this is a bug per se.
The short options seem to work (note there is only one default short option 
-D), but used in conjunction with --test, then the -D loses.

So I'm moving this bug to "Needs Design Decision", while we decide what to do 
:-)

----------------------------------------
Bug #2420: The getopt parser in application.rb only seems to handle long options
http://projects.reductivelabs.com/issues/2420

Author: James Turnbull
Status: Needs design decision
Priority: Normal
Assigned to: Luke Kanies
Category: executables
Target version: 0.25.0
Complexity: Easy
Affected version: 0.24.8
Keywords: options daemonize


See this code block in application.rb:

<pre>
   # used to declare code that handle an option
    def option(*options, &block)
        long = options.find { |opt| opt =~ /^--/
}.gsub(/^--(?:\[no-\])?([^ =]+).*$/, '\1' ).gsub('-','_')
        fname = "handle_#{long}"
        if (block_given?)
            meta_def(symbolize(fname), &block)
        else
            meta_def(symbolize(fname)) do |value|
                self.options["#{long}".to_sym] = value
            end
        end
        @opt_parser.on(*options) do |value|
            self.send(symbolize(fname), value)
        end
    end
</pre>

Brice - not sure if I am understanding this correctly but wouldn't this ignore 
any short options?


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to