I have a program which uses switches in the form:
/path/to/binary --foo:on|off --bar:opt1|opt2|opt3 --path:filename
I have been able to create a bash autocompletion file which adds the --foo
or --bar
switches, but I can't seem to add detection on the previous used switch to complete the on|off
because the colon is not recognised by bash as a split character between the switch and its value. Bash autocompletion works fine if I make it accept --foo on|off
using a space, but unfortunately the program requires the colon and the completion with the space will be incorrect.
Can this be fixed modifying somehow COMP_WORDBREAKS
? I can't see any example in the man page to do this.