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

Re: _multi_parts and -q



On Jun 17,  2:50pm, Danek Duvall wrote:
} Subject: _multi_parts and -q
}
} I was hoping that this
} 
}     _wanted dataset expl "$expl_type" _multi_parts "$@" -q / datasetlist
} 
} would add slashes as auto-removable suffixes, but it doesn't appear to.

There are a couple of things going on here, neither of which I entirely
understand.

The options passed to _multi_parts are only passed through to compadd in
the event that there is exactly one possible match.  So in the case of
ambiguity, the -q is ignored and the suffix is never autoremovable.

Even more confusing, though, is that on lines 169, 173, and 176 the
separator is passed through to compadd with -S (still ignoring -q) but
on lines 191, 211, 244, 249 and 253 an explicit -S '' is passed, even
though a separator may be included in the partial match to be inserted
on the line.

I suspect there's an underlying assumption that the strings passed to
_multi_parts (in this case, the values in $datasetlist) represent ALL
possible strings that could appear in a valid command line at that
position; so that it would never make sense to stop completing in the
middle and remove the separator.  Either the separator will always be
needed in order to form a valid command line, or the ambiguity occurs
before reaching the separator and it won't appear in the completion.



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