I'm looking for an easy way to "inherit" Bash completion functions from a program into a script.
Say there's a program foo
that provides its own Bash completion, such that $ foo sub<TAB>
completes to $ foo subcommand
. Now I want to write a script foo-extra
that takes the same arguments as foo
, doing some extra stuff before calling foo <arguments>
. What's the easiest way to make the foo-extra
script piggy-back on foo
's completion function?