-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Feature request] Autocomplete #2
Comments
Thanks for feedback. I'm not so familiar with how the auto-complete works. Thanks for mention infi.docopt_completion, it should be a good example that I can get start with. So far the If you know any source that I can get more knowledge about this "tab-to-complete", please tell me too, thanks :D |
I learned a bit here. Shells other than bash of course have a different way to get auto-completion. Bash has many pre-defined completions (see
Assume the script
To install completion for
Or if you dare install the completion system-wide for every user:
In any case, the script |
commit (I'm kind of signing to a wrong issue number 😭 ) First simple implement (only bash so far). Feel free to commit. |
The thing that gets me about docopt is that there is nothing like argcomplete for argparse. I know one can use
docopt_wordlist
anddocopt-wordlist.bash
fromdocopt.rs
but that is hard to set up and doesn't work in some cases. Another solution is infi.docopt_autocomplete that creates bash and zsh completion files. The drawback with that: the user has to update the completion files by hand, EVERY time, the options change in the original script. I think a command line interface goes hand in hand with auto-completion. So if you feel, you're being bored, a nice mechanism for auto-completing commands would be good that doesn't require installation beyond a simplepip install
. (See Issue discussed in docopt repository for reference).Desired result:
If I have and the desired feature "docpie auto-completion" installed:
And
prog.py
is in the current working directory of my shell together with these other files: example1.txt, example2.txt, example3.txtI want to be able to auto-complete in the shell like this:
Ideally the auto-completion is smart and uses existing built-in completions for things like files, hostnames, ip-adresses, kernel-versions and s.o. In Bash they can be listed with
complete -p
.The text was updated successfully, but these errors were encountered: