Easy way to "inherit" Bash completion -


i'm looking easy way "inherit" bash completion functions program script.

say there's program foo provides own bash completion, such $ foo sub<tab> completes $ foo subcommand. want write script foo-extra takes same arguments foo, doing stuff before calling foo <arguments>. what's easiest way make foo-extra script piggy-back on foo's completion function?

your foo completes using function (if standard, defined in /usr/share/bash-completion/completions/foo, , possibly called _foo). command makes function completion function is:

complete -f _foo foo 

you can co-opt same function arbitrary command:

source /usr/share/bash-completion/completions/foo complete -f _foo foo-extra 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -