Closed Nardol closed 6 months ago
Thanks for this. Very surprised I had not heard of the argcomplete
package before but I will use this frequently now!
I moved your argcomplete.autocomplete()
line because it should be before the config file is read. No point reading that file for every completion and it speeds it up slightly.
I released a new version 1.13 with this change.
Actually, just realized that I have used argcomplete
previously in a project but that automatic PYTHON_ARGCOMPLETE_OK
feature wasn't present then. Much better way to do it.
This is the same method used by Pipx, it allows easilly adding shell auto-completion by only adding a few lines of code. It uses Argparse to generate auto-completion. For more information about Argcomplete, you can read the documentation.