In Bashbash, it's easy enough to set up customized completion of command arguments using the complete built-in. For example, for a hypothetical command with a synopsis of foo --a | --b | --c,
foo --a | --b | --c
you could do complete -W '--a --b --c' foo.
complete -W '--a --b --c' foo
You can also customize the completion you get when you press Tab at an empty prompt using complete -E, for example complete -E -W 'foo bar'. Then, pressing tab at the empty prompt would suggest only foo and bar.
How do I customize command completion at a non-empty prompt? For example, if I write f, how do I customize the completion to make it complete to foo?
(The actual case I'd like is locTAB → localc. And my brother, who prompted me to ask this, wants it with mplayermplayer.)