-
-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't get --install-completion to work #54
Comments
Actually, there is a bug with the generation because the full path of the app file (foo in your case) is not written. Temp workaround: eval $(env COMMANDLINE="${words[1,$CURRENT]}" _APP.PY_COMPLETE=complete-zsh python PATH_TO_FOO/foo.py) You could also report the bug to Click-Completion |
Hi everyone! Thanks for the discussion here. For auto completion to work, you have to create a Python package, there's a new section in the docs about that: https://typer.tiangolo.com/tutorial/package/ 📝 If you just want to run simple scripts and have completion in your shell, you can use the new Typer CLI: https://typer.tiangolo.com/typer-cli/ 🚀 ⌨️ |
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues. |
I am still facing the same issue. Let me know if this has been resolved |
same here, i have a tool called zetta, that i made it a command line tool with
but the autocompletion still does not work.... same steps for bash works... |
well , i think i solved this problem by adding the following lines to my .zshrc
|
I'm still not able to get completion to work. My setup is pretty much identical to @shelper My (entire) # ~/.zshrc
autoload -Uz compinit
fpath+=~/.zfunc
compinit My #compdef nbpreview
_nbpreview_completion() {
eval $(env _TYPER_COMPLETE_ARGS="${words[1,$CURRENT]}" _NBPREVIEW_COMPLETE=complete_zsh nbpreview)
}
compdef _nbpreview_completion nbpreview Seems the correct file is registered, # Command to show which completion file is registered
% whence -v $_comps[nbpreview]
_nbpreview_completion is a shell function from /Users/pawlu/.zfunc/_nbpreview
% nbpreview --<TAB>
# No output, completion |
From here I got the workaround to add |
given this program:
I run:
./foo.py --install-completion
I see:
I source my
.zshrc
and then type./foo.py
and hit tabI see this:
./foo.py env: foo.py: No such file or directory
The text was updated successfully, but these errors were encountered: