-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
parse/parseAsync
cannot be used multiple times on the same Command
instance
#2263
Comments
Hm. Found multiple closed duplicates which are all solved by referring to the added text in
|
Throwing might be the best thing to do as another user mentioned here: #2246 (comment) This should be fixed. |
There were no related issues opened for a while after the note got added to the README in #2036, but this issue and two others just recently:
I expect prohibiting repeated calls will break some programs, but I also expect most of the cases will be technically unsafe and the author had not noticed there is state left behind from the first parse. I am wondering whether to throw an error for multiple calls to parse in the next major version. |
yep, I think this is what everyone are doing right now until they figure that something is wrong. Throwing is a fast and simple take on the problem. Supporting multiple calls to |
Opened a PR to allow multiple calls to |
Support for multiple parse added in version 13.0.0 |
Not sure if it's a known gotcha or an actual bug, but I've noticed that I can't use
parseAsync
multiple times with different args on the sameCommand
instance (for ex. in tests), because internally all parsed options are cached.The text was updated successfully, but these errors were encountered: