Issue #19306 has been updated by Charlie Sharpsteen.

Status changed from Unreviewed to Accepted
Affected Puppet version changed from 3.1.0 to 3.0.0

Also appears that partial matching works in the 2.7.x series but not 3.x. 
Bisected the change in behavior down to 
[cb3ce74](https://github.com/puppetlabs/puppet/commit/cb3ce74). Appears this is 
where the split between OptionParser and Trollop was introduced.

----------------------------------------
Bug #19306: Puppet option parser accepts partial matches but doesn't use them 
to alter configuration values
https://projects.puppetlabs.com/issues/19306#change-91296

* Author: Charlie Sharpsteen
* Status: Accepted
* Priority: Normal
* Assignee: 
* Category: Faces
* Target version: 
* Affected Puppet version: 3.0.0
* Keywords: options
* Branch: 
----------------------------------------
This popped up during investigation of #19153.

When a Puppet command such as `agent` encounters an unknown option, it throws a 
warning:

    # puppet agent --foo
    Error: Could not parse application options: invalid option: --foo

Similarly, when it encounters a known option, it will alter a config value:

    # puppet agent --configprint daemonize
    true

    # puppet agent --no-daemonize --configprint daemonize
    false

However, the parser will also accept partial matches:

    # puppet agent --no-daemoniz --configprint daemonize
    true
    # puppet agent --no-daemon --configprint daemonize
    true
    # puppet agent --no-da --configprint daemonize
    true

    Edge Cases:

    # puppet agent --no-daemonizer --configprint daemonize
    Error: Could not parse application options: invalid option: --no-daemonizer
    # puppet agent --no-d --configprint daemonize
    Error: Could not parse application options: ambiguous option: --no-d

The problems with partial matching is that the flags don't alter configuration 
values and no warning or error is emitted to alert users that their input is 
incorrect or that their intentions are not being honored.


-- 
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://projects.puppetlabs.com/my/account

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


Reply via email to