Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When there are multiple optional positional arguments, their completers are combined. #221

Open
calc84maniac opened this issue Aug 2, 2017 · 1 comment

Comments

@calc84maniac
Copy link

The title is fairly self-explanatory. If you add multiple positional arguments with nargs='?', the completer for every unentered argument is called and combined, rather than just the first unentered one. As far as I can tell, this is not the behavior accepted by argparse (which always assigns optional arguments greedily in positional order). This is easiest to demonstrate by creating multiple arguments with different 'choices' lists.

This issue seems to be somewhat acknowledged by this comment, but I don't see where the ambiguity comes into play thanks to the positional ordering. I'm dealing with a choices argument followed by a filename argument, and there's no case where the file completion should need to occur if the choice hasn't been entered yet.

@evanunderscore
Copy link
Collaborator

You can see a bit more of the discussion on this in #133. In the case where you're only using nargs='?', I think you're right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants