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

Re: [BUG] multibyte never set according to setopt/unsetopt output



On 12/20/23, Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
>
>> On 20/12/2023 16:44 GMT Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>>
>>
>> On Wed, Dec 20, 2023 at 8:22 AM Peter Stephenson
>> <p.w.stephenson@xxxxxxxxxxxx> wrote:
>> >
>> > I don't know of a "just show the **** options" option
>>
>> There isn't one, but "set -o" will do what you want, I think.
>
> That's still not got no negatives, for people who don't not
> hate complicated logic, but you can do something like
>
> print -l ${(ko)options//(#m)*/${(r:21:)MATCH} $options[$MATCH]}

Really? I get all options listed in the positive sense regardless of
their state:
% printf '%-20s := %s\n' "${(@kv)options}"|grep '^no'
notify               := off
nomatch              := on

Diffing the output (after adjusting the := format and sorting) shows
an empty diff for me.
% printf '%-21s %s\n' "${(@kv)options}" > mine
% print -l ${(k)options//(#m)*/${(r:21:)MATCH} $options[$MATCH]} > pws
% md5sum mine pws
9bc24b5a4ee8791d4b093f8727e15dd3  mine
9bc24b5a4ee8791d4b093f8727e15dd3  pws

-- 
Mikael Magnusson




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