This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author porton
Recipients porton
Date 2018-08-22.00:13:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1534896831.7.0.56676864532.issue34458@psf.upfronthosting.co.za>
In-reply-to
Content
I have:

parser.add_argument('-p', '--preload', help='preload asset', action='append', metavar='NAMESPACE')

I want also add:

parser.add_argument('-f', '--file', help='preload file', action='append', metavar='FILE', dest='preload')

This way I could specify -p and/or -f options in any order (like: first -p then -f then -p again) and store then in 'preload' field in the order which the user specified the options.

But I have no way to know if an option is -p or -f :-(

Please add something to argparse to solve this problem.
History
Date User Action Args
2018-08-22 00:13:51portonsetrecipients: + porton
2018-08-22 00:13:51portonsetmessageid: <1534896831.7.0.56676864532.issue34458@psf.upfronthosting.co.za>
2018-08-22 00:13:51portonlinkissue34458 messages
2018-08-22 00:13:51portoncreate