bash-completion for working with
This is an example extract of the minimum amount of the bash-completion project required to use these two functions:
The functions here are copied verbatim from the bash_completion source.
I recommend not using this extract unless there are no other alternatives. Instead, prefer installing the
bash-completion package from your package manager,
or install bash-completion from source.