Skip to content

gh-66419: Make optional arguments with nargs=REMAINDER consume all arguments#124509

Open
serhiy-storchaka wants to merge 2 commits intopython:mainfrom
serhiy-storchaka:argparse-optional-remainder
Open

gh-66419: Make optional arguments with nargs=REMAINDER consume all arguments#124509
serhiy-storchaka wants to merge 2 commits intopython:mainfrom
serhiy-storchaka:argparse-optional-remainder

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Sep 25, 2024

…all arguments

It no longer stops at the first '--'.
Copy link
Member

@savannahostrowski savannahostrowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comment for the news entry but LGTM so long as we don't backport!

Comment on lines +1 to +2
Optional argument with :ref:`nargs` equals to ``argparse.REMAINDER`` now
consumes all remaining arguments, not only to the first ``'--'``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Optional argument with :ref:`nargs` equals to ``argparse.REMAINDER`` now
consumes all remaining arguments, not only to the first ``'--'``.
Optional argument with :ref:`nargs` equals to ``argparse.REMAINDER`` now
consumes all remaining arguments including ``'--'``.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

argparse not including '--' arguments in previous optional REMAINDER argument

2 participants