You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: