Re:Creating a bash completion script
by peff on Monday September 24, 2018 @04:40PM
(#18061209)
This makes sense for some completions (e.g., vanilla lists of options). But often the completion depends on other context that the binary doesn't need to know about. For example, I complete `git grep` patterns based on ctags. There's no reason git should know about ctags; it's only my personal completion that brings the two together.
[ Parent
| on HN ]
That is probably a very rare case, and any shell-agnostic-completion-protocol could be extensible to handle such a case. But, I think 99% of completions that people want/use on a daily basis could be covered by a machine-readable version of the usual "--help" option (with support for placement of paths, pids, strings, numbers etc.).
Re:Creating a bash completion script
by loa-in-backup on Tuesday September 25, 2018 @02:51AM
(#18064159)
If it doesn't work reliably for all cases, there would soon be inevitable need for the kind of scripted completion we have now.