Repository navigation
Replies: 1 comment
|
This is how the two options are wired in 0.27.3, not a detection problem on your side. In Two ways to name the shell without importing
I could not find an earlier issue or discussion asking for an explicit shell argument, so a feature request seems reasonable: the callbacks already accept a string, so making the option's value optional would be a small change. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
--show-completion SHELLand--install-completion SHELLcan't be pointed at a shell explicitly. A shell name given after the flag is ignored, and Typer falls back to auto-detection. When detection fails (CI, containers,SHELLunset or a non-shell, IDE terminals), there's no way to say "generate the zsh script" through the public CLI. The error also prints an empty shell name.Minimal example
It's the same without
shellinghaminstalled. Thezshargument is not used, and--helpshows both options as plain flags with no shell argument.Expected
--show-completion zshprints the zsh completion script, and--install-completion zshinstalls it, regardless of what auto-detection finds. Auto-detection would apply only when no shell is named. If detection fails, the error would name what was detected and suggest passing the shell explicitly.Why it matters
Tools that ship completion setup in installers or dotfiles, or run on hosts where detection is unreliable, end up calling
typer._completion_shared.get_completion_script(...)/install(...)directly to bypass detection. That couples them to private API.Environment
SHELLunset.All reactions