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
First of all, I love Click, and I want to thank you for taking the time to build and maintain such a fantastic library!
Problem
The Name Your Options documentation seems to be incorrect. The second point in choosing an option's name says,
If there is at least one name prefixed with two dashes, the first one given is used as the name.
However, it seems that instead of the first double-dash-prefixed option, the last is used as the name.
At the bottom of the "Name Your Options" section, bulleted examples showing how names are chosen are given. The second to last bullet point is as follows:
"--f", "--foo-bar", the name is f
This is not what happens, as can be seen from the below snippet that recreates this example.
Expected Behavior
According to the docs linked above, executing the below snippet...
Personally, I think that using the first double-dash-prefixed option (as the docs state) makes the most sense. As someone who has never contributed to Click (so take this with a grain of salt), it looks like src.click.core.Option._parse_decls might need to be updated to be brought in line with the docs. I'd be happy to take a look and submit a PR if you're open to it. If you'd instead prefer to change the docs to reflect the actual behavior, I'd also be happy to make a PR.
Thanks for your time and for making such an awesome library!
The text was updated successfully, but these errors were encountered:
First of all, I love Click, and I want to thank you for taking the time to build and maintain such a fantastic library!
Problem
The Name Your Options documentation seems to be incorrect. The second point in choosing an option's name says,
However, it seems that instead of the first double-dash-prefixed option, the last is used as the name.
At the bottom of the "Name Your Options" section, bulleted examples showing how names are chosen are given. The second to last bullet point is as follows:
This is not what happens, as can be seen from the below snippet that recreates this example.
Expected Behavior
According to the docs linked above, executing the below snippet...
... should print out...
Actual Behavior
Instead the following is printed:
Environment
Personally, I think that using the first double-dash-prefixed option (as the docs state) makes the most sense. As someone who has never contributed to Click (so take this with a grain of salt), it looks like
src.click.core.Option._parse_decls
might need to be updated to be brought in line with the docs. I'd be happy to take a look and submit a PR if you're open to it. If you'd instead prefer to change the docs to reflect the actual behavior, I'd also be happy to make a PR.Thanks for your time and for making such an awesome library!
The text was updated successfully, but these errors were encountered: