Command names with underscores must be invoked with dashes instead when upgrading from 6.7 to 7.0
See original GitHub issueClick 7.0 is breaking upstream packages, in our case mschematool
(issue reported there: https://github.com/aartur/mschematool/issues/11).
After upgrading from 6.7 to 7.0, the init_db
command can no longer be found.
$ mschematool xyz init_db
Usage: mschematool [OPTIONS] DBNICK COMMAND [ARGS]...
Try "mschematool --help" for help.
Error: No such command "init_db".
ERROR: Job failed: exit code 2
Issue Analytics
- State:
- Created 5 years ago
- Comments:18 (11 by maintainers)
Top Results From Across the Web
VMware ESXi Upgrade - VMware vSphere 7.0 - VMware Docs
VMware ESXi Upgrade is for anyone who needs to upgrade from earlier ... and special characters such as underscore or dash when you...
Read more >Upgrading To Newer Releases — Click Documentation (7.x)
Commands that take their name from the decorated function now replace underscores with dashes. For example, the Python function run_server will get the...
Read more >Bash Reference Manual - GNU.org
The Bash manual page should be used as the definitive reference on ... the resulting fields are used as the command name and...
Read more >Spring Boot Reference Documentation
You do not need to use the CLI to work with Spring Boot, but it is a quick ... period-separated key names, but...
Read more >15.4. Extending clara with Plugins — Clara Deploy SDK 0.7.3 ...
The command from the above example can be invoked using either a dash ( - ) or ... with an underscore $ clara...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can still use underscores by specifying the command names explicitly. It’s just that the default is now to replace with dashses, to look more consistent with other CLI tools, whereas before you would have had to specify those explicitly.
So if you want to upgrade your app to 7.0 but continue using the old names, you can name them explicitly, or use a
Command
subclass that doesn’t have the new behavior. There are upgrade strategies here, it just means Click 7.0 is not a drop-in upgrade in some cases.@davidism thanks for the commit ref and the explanation. I think it could have been more prominently described in the changelog (given python naming conventions would imply an insignificant number of people would hit this) but I do understand it was a major release. On our side, probably we should have pinned our dependencies better -_-.
perhaps it makes sense to attempt both for some interim period? of course, you’d have to dedupe (and raise some exception) when someone goes wild and attempts to register both styles…
@di nice to see you!