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
If you have nargs > 1 and you want to have different choices for each arg, you have to use a custom action (see http://stackoverflow.com/q/8624034/161801). It would be nice to have some way to still complete in that case, so that it doesn't complete the wrong thing for the wrong argument.
The text was updated successfully, but these errors were encountered:
It's definitely possible to do what you describe by defining a callable completer for your custom action and introspecting the arguments parsed so far (see the callable completer spec). Do you have something more intuitive in mind?
I'll take a look at that. If I think of a more intuitive way to do it while implement it, I'll let you know.
I was hoping that defining __iter__ on an object passed to choices would be enough, but apparently argparse itself doesn't make this distinction (i.e., instead of iterating (choice1a, choice2a), (choice1b, choice2b), and so on, you have to iterate choice1a, choice2a, choice1b, choice2b, ....
If you have nargs > 1 and you want to have different choices for each arg, you have to use a custom action (see http://stackoverflow.com/q/8624034/161801). It would be nice to have some way to still complete in that case, so that it doesn't complete the wrong thing for the wrong argument.
The text was updated successfully, but these errors were encountered: