-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
I recently read through a few "defects" in your issue tracker here with complaints about a change in behavior where Click v7 slightly modified the command name mapping logic so that Python method names with underscores in them are renamed to use dashes in their respective command names (ie: def my_command
-> tool my-command
).
Regardless of the debate that seems to be lively and ongoing on which is better and such, I couldn't help but notice that the description used in the documentation for Click is misleading in this regard. Take this snippet from the latest online docs:
The name of the command defaults to the name of the function.
As I have just illustrated, this is not entirely accurate. When your function name has underscores in it, the command name does not default to the same name as the function. Rather it defaults to the same name as the function but with underscores replaced with dashes.
Given the fact that this behavior is non-obvious to new users such as myself, and confusing when encountered by experienced users who are used to the previous behavior, I'd suggest that updating the docs to reflect this discrepancy would be helpful.