#26 pass through mode for unknown options


Would you be willing to add a mode to optparse that would "pass through" any command line options that the user did not register with add_option()?

I have a scripting toolchain that looks like this:

regression test script: options for platform, etc.
Install script: options for tarfile,
install directory, etc.
configure script: autoconf script with
autoconf options

The indentation indicates a call level. Each level needs to strip options particular to itself, and then pass the remaining options to a lower level.

It seems natural to add a mode to the optparse internal state that controls whether optparse:

* (current behavior) dies when an unregistered
option is encountered


* (desired behavior) passes unregistered options
through as unparsed arguments

Would this be something you would be willing to add to Python 3.0?

Best regards,


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks