complgen
complgen copied to clipboard
Allow specifying regex that external command output must match
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.