Is there a simple way to embed the completion features inside a script, for bash ?I have a script that I want to redistribute, but I can't ask the people to add something inside their /etc/bash_completion.d  in order for them to get the completion working fot my script...
Redistributable completion for my bash scripts
bash;shell script;autocomplete
There isn't a standard location for bash completions in home directories. You can either instruct people to copy your completion code into their .bashrc, or instruct them to save your completion definition script somewhere (which should not be on their $PATH) and to source it from their .bashrc. I recommend the latter since it makes upgrades a lot easier.. ~/.bash_completions/jmc_appConventionally, your completions should be defined in a script with the same name as the program it completes for, containing a function definition with the same name with an underscore prepended, and calling complete to install the completion:# jmc_app completion_jmc_app () {  }complete -F _jmc_app jmc_app