Closed wiz21b closed 1 year ago
I see this:
complete -o bashdefault -o default -o nospace -F _python_argcomplete /home/stefan/Projects/raingen/hydro.py
When I complete with full path like this, it works:
stefan@debian:~/Projects/raingen$ /home/stefan/Projects/raingen/hydro.py -[TAB]
--all-series --cumulative-series --help --pearson --some-series
So this gave me the idea of doing this:
stefan@debian:~/Projects/raingen$ eval "$(register-python-argcomplete ./hydro.py)"
stefan@debian:~/Projects/raingen$ ./hydro.py -[TAB]
--all-series --cumulative-series --help
Which works. So I'm wondering, does the global complete actually works ?
stefan@debian:~/Projects/raingen$ ls ~/.bash_completion.d/
total 8.0K
-rw-r--r-- 1 stefan stefan 4.1K Feb 17 11:17 python-argcomplete
And now,
stefan@debian:~/Projects/raingen$ python3 hydro.py --[TAB]
doesn't work anymore... I'(m lost :-(
Please follow the debugging instructions in the readme: https://github.com/kislyuk/argcomplete/blob/bf16566adcfb2fd0307c6ecdf24304b21b0b5752/README.rst#debugging
If you see no debug output at all with that variable set, then the completion hook is not being invoked for your program.
Thanks for your interest in argcomplete. If global completion does not work for you, you're probably not configuring your bash completion correctly, or the version of bash that's running (which is not necessarily what's returned by bash --version
) is too old. Please follow the instructions listed by @evanunderscore, and compare your system's behavior to a clean VM/container image install.
Since I'm unable to reproduce your issue, I'm going to close this for now. If you still need help, please feel free to comment or open a new issue.
Hello,
I'm facing an issue I can't fix myself...
This is my environment:
This completion works:
But it doesn't work if I invoke python instead of python3
Moreover, my script is executable:
and starts like this
but this doesn't work either:
Do you know what's going wrong ? I have installed the global autocomplete as explained in your documentation (option --user)... Do you know how I can debug that ? I saw there's some debug code in your scripts but don't know how to use them...
Thanks !