On 2/20/22 1:40 PM, konsolebox wrote:
It's difficult to make values like 'release[remote]' to become
properly quoted or escaped because if the current word starts with a
quote (which can be a ', a ", or a $'), a manually quoted COMPREPLY
value like release\[remote\] will make the completed value include the
backslashes (e.g. 'release\[remote\]'). On the other hand if a
COMPREPLY value isn't escaped with backslashes, the result will be a
plain release[remote] (no backslash escapes) which results to
unintended globbing. A possible workaround for this would be to check
if the current word is openly quoted before deciding if manually
quoting is needed or not. And the only clean-and-close-to-accurate
way of doing it is to process the word against compgen -W and do
tests. Manual parsing would be terrible.
If `complete` can have an option which forces all completed values to
be properly quoted, this manual quoting hacks wouldn't be needed.
What does `properly quoted' mean here and how does it differ from the
quoting you get when you force complete to treat the completions as
filenames with `complete -o filenames'?
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/