Assume I have a program called script.py
and it allows for the command line option -i
which requires an additional keyword argument, such that I call
python script.py -i foo
Now assume in my working directory I have a file named tags.txt
which includes a list of strings. Now I want the shell to autocomplete whatever comes after -i
when calling the script according to the list of strings given in tags.txt
. The idea is the store some common input arguments for -i
in that file in order to reduce typing mistakes and ensure faster input. Is that possible with a pure Python solution?