[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom word completion, word splitting, bad behavior

From: Nick Patavalis
Subject: Re: Custom word completion, word splitting, bad behavior
Date: Thu, 8 Feb 2018 00:09:28 +0200

On Wed, Feb 7, 2018 at 10:56 PM, Chet Ramey <chet.ramey@case.edu> wrote:
> On 2/6/18 3:52 PM, Nick Patavalis wrote:
>> In any case, splitting it like:
>>   foo | --bar | =" | baz" aa bb
>> (the last part a single word) does not look reasonable to me (even if
>> it may be convenient in some occasions I cannot think of). It looks
>> like a mix-up between the roles of " as a quoting character and as a
>> word break character.
> That may, in fact, be unreasonable. I'll take a look.
> (It is not what I thought you were talking about as a problem: it seemed
> to me that the `="' part was where you were objecting.)

My worst problem is not the way '="' is split, but instead, how the rest
of the line is not (baz" aa bb).

To me, the best solution would seem to be *not* to treat "=" as a
separator (word-break character)---since you *don't* treat it as such
*anyway*, other than when it appears as part of a sequence of other
separators. That is, if this is ok

  foo bar "baz" ---> foo | bar | "baz"

then, that's also ok:

  foo bar="baz" ---> foo | bar | = | "baz"

>> I guess my question is: how would you suggest I handle completion for
>> a command, when an option is given like --bar="baz"?
> Are you trying to complete the option word?

The option value ("baz"---which is not a big problem), but mostly
*everything past it* (the subsequent options and arguments).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]