The auto-completion feature does not seem to work for me. I created a small test script that reproduces the problem on my setup (Ubuntu 20.04, bash 5.0.17, python 3.8):
#!/usr/bin/env python3
# PYTHON_ARGCOMPLETE_OK
import argparse
import argcomplete
if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Parser test')
    parser.add_argument('-p', '--port', type=int, default=1346)
    parser.add_argument('--host', default='localhost')
    argcomplete.autocomplete(parser)
    parser.parse_args()
I have install argcomplete by running pip3 install argcomplete and activated it by running activate-global-python-argcomplete --user. What am I missing?
Whilst writing this question I found that for python3 I should be using sudo activate-global-python-argcomplete3 followed by exec bash to enable it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With