3 ms·
well, your completion script doesn't _need_ to be written in bash. If you're writing a completion script for an executable, that executable can be called with
by toolslive 5y ago
well, your completion script doesn't _need_ to be written in bash.
If you're writing a completion script for an executable, that executable can be called with an option that generates the completions for bash to consume.
You just need to generate the output in the expected format and install a softlink .
Hope this can give you some comfort.
- Per_Bothner 5y agoBash completion for the domterm command (a terminal emulator) calls the domterm command itself with a special "#complete-for-bash" option: complete -o nospace -C 'domterm "#complete-for-bash" "$COMP_LINE" "$COMP_POINT"' domterm It works pretty well has the advantage that it automatically ties the completion to the executable, avoiding version mismatches. It would be great if other shells could use a similar mechanism. Then you could use the same completion logic for multiple shells. A complication is that zsh and fish completion provide descriptive help text; there would need to be a mechanism for a "completion option" to provide such help text.