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
{{ message }}
Repository navigation
strip "_command" suffix when generating command name #2322
You often want a command to have the same name as a function it is wrapping. However, this will cause a name collision, if your command is going to call init_data its function can't also be called init_data. So instead it's written as init_data_command, and then the command name has to be specified manually @command("init-data"). Click should remove a _command suffix when generating the command name from the function name.
Activity
bebleo commentedon Sep 10, 2022
Hi @davidism, Am I right in assuming the expected behaviour would be that both
_commandand_cmdsuffixes are dropped?An example using
_cmdas a suffix:click/examples/imagepipe/imagepipe.py
Lines 74 to 98 in fb43272