I would like to get autocomplete in my python scripts as well in the arguments.
I never understood how bash_completion works (for arguments), but after digging out, I realized that:
- it uses "complete" to bind the completion function to the command
- each trailing function is basically a copy of the argument parser
The second point, in particular, is small, because I would like it to be automatically generated.
It would be best if the shell would ask my program in each TAB what to do, but I get the impression that this really does not work, is it right?
The second option, probably, is to simply write a converter from the argparse parser into the correct shell.
python argparse bash-completion
andrea_crotti Dec 05 '11 at 15:48 2011-12-05 15:48
source share