Re: Space vs. non-space separators in COMP_WORDBREAKS

2021-12-17 Thread konsolebox
On Fri, Dec 17, 2021 at 7:13 PM Chet Ramey wrote: > > On 12/17/21 2:00 PM, konsolebox wrote: > > On Sat, Dec 18, 2021, 00:49 Chet Ramey, wrote: > >> Well, the documentation says the line gets broken into words the way > >> readline does it, and readline uses the characters in > >> rl_completer_wo

Re: Space vs. non-space separators in COMP_WORDBREAKS

2021-12-17 Thread Chet Ramey
On 12/17/21 2:00 PM, konsolebox wrote: On Sat, Dec 18, 2021, 00:49 Chet Ramey, wrote: Well, the documentation says the line gets broken into words the way readline does it, and readline uses the characters in rl_completer_word_breaks as delimiters but doesn't remove them from the list. It just

Re: Space vs. non-space separators in COMP_WORDBREAKS

2021-12-17 Thread konsolebox
On Sat, Dec 18, 2021, 00:49 Chet Ramey, wrote: > Well, the documentation says the line gets broken into words the way > readline does it, and readline uses the characters in > rl_completer_word_breaks as delimiters but doesn't remove them from > the list. It just uses them as word separators to bo

Re: Space vs. non-space separators in COMP_WORDBREAKS

2021-12-17 Thread Chet Ramey
On 12/16/21 6:56 PM, konsolebox wrote: If I have a function like function _complete_something { printf -v __ '%q ' "$@" logger -p debug -t something "Args: $__" logger -p debug -t something "$(declare -p COMP_WORDS)" } And in COMP_WORDBREAKS I have '=' inclu

Re: Have a method to prevent space from being added after an invalid one-result completion

2021-12-17 Thread konsolebox
Nevermind I found a way. The trick is to enable nospace by default and add space manually to only result when result is 1 and is valid. -- konsolebox

Have a method to prevent space from being added after an invalid one-result completion

2021-12-17 Thread konsolebox
If I have a completion setup like this: complete -F complete_something something And then get complete_something to assign a single directory-only result to COMPREPLY, I'd like the completion mechanism to not add a space just so the user would know immediately that it isn't a valid completion. I