Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: clang completion



Matthew Martin wrote on Sat, Jul 07, 2018 at 15:57:51 -0500:
> local -a options=(${${${(f)"$(_call_program clang clang --autocomplete=${words[CURRENT]/=/\=,})"}//:/\\:}/$'\t'/:})

Note that it's not trivial to support _approximate or _correct here, because
the --autocomplete contract is "give me a prefix", not "give me all possible
matches for me to sort out".  That is: clang wants to do the matching itself,
and it doesn't honour zstyle's.

Debian's bts(1) has the same issue in its 'listcachedbugs' subcommand.
I suppose that as an ecosystem we should be trying to get upstreams not to
implement the clang/bts semantics but a "dump all possible values for this
word" semantics.

Cheers,

Daniel
(still hoping for a world in which all commands have
a --output-my-grammar-in-a-well-known,-machine-parseable-format flag)

> compset -P '*='
> _describe options options



Messages sorted by: Reverse Date, Date, Thread, Author