ruff
ruff copied to clipboard
`generate-shell-completion` is a valid `ruff` command, but is not listed in `ruff help`
As-of ruff 0.4.10, I've observed that:
ruff generate-shell-completionis documented in the docsruff help generate-shell-completiongenerates some useful help- But,
ruff helpdoes not listgenerate-shell-completionin the "Commands" section
Personally I think it would aid discoverability to add it to the list in the top-level ruff help listing.
I believe this is intentionally hidden, perhaps because it's only intended to be run once? I'm not sure.
Not a very good reason but I think one reason is that generate-shell-completion kind of messes with the ruff --help layout. But we could solve this by shortening the command name to completion or shell-completion.
What's interesting is that gt also doesn't show the completion command when running gt --help. It only shows it when entering an invalid command.
What's interesting is that gt also doesn't show the completion command when running gt --help. It only shows it when entering an invalid command.
Probably a silly question - what program is gt please? :) A web search isn't helping me much.
Oh sorry. It's graphite CLI.
Being somewhat pedantic, I did notice that docs/configuration.md says that ruff help gives the "full list" of top-level commands, so if deciding to hide this command then perhaps this should be modified to "gives a subset of the top-level commands"!
At least to my taste, I like the guarantee of the 'full list' though.
I too was looking for generate-shell-completion command from ruff help if you don't want it to default, maybe add --full-list or similar option to show a full list of commands with --help or help command?
btw, uv help does list out generate-shell-completion command (tested with uv 0.17.13) (noticed this from comment in https://github.com/astral-sh/uv/issues/2191)
$ uv help
An extremely fast Python package manager.
Usage: uv [OPTIONS] <COMMAND>
Commands:
run Run a command or script
init Create a new project
...
self Manage the uv executable
generate-shell-completion Generate shell completion
help Display documentation for a command