complgen icon indicating copy to clipboard operation
complgen copied to clipboard

Allow specifying regex that external command output must match

Open adaszko opened this issue 5 months ago • 0 comments

If we had a way to specify that <FS@fish> ::= {{{ string split ' ' --fields 3 </proc/mounts | sort --unique }}} always matches \w+, it would be possible to complete <FS>[,<FS>]....

Working version syntax:

duf -hide-fs <FS>[,<FS>]...;
<FS@fish> ::= {{{ string split ' ' --fields 3 </proc/mounts | sort --unique }}}(fish="\w+");

Such mechanism would relax the biggest restriction of current grammars -- that an external command has to occur only at a tail position.

There is no common syntax for regexes across all shells, so shell-specific ones are used instead.

Inspired by #53.

adaszko avatar Sep 15 '24 09:09 adaszko