[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Feature Request: Add option to make completed values always become prope
From: |
konsolebox |
Subject: |
Feature Request: Add option to make completed values always become properly escaped |
Date: |
Sun, 20 Feb 2022 18:40:27 +0000 |
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.
--
konsolebox
- Feature Request: Add option to make completed values always become properly escaped,
konsolebox <=