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

Re: Trying to learn ... RCS and GLOBAL_RCS



On 3/26/22, Perry Smith <pedz@xxxxxxxxxxxxxxxx> wrote:
>
>
>> On Mar 26, 2022, at 11:48, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
>> wrote:
>>
>> On Sat, Mar 26, 2022 at 9:45 AM Perry Smith <pedz@xxxxxxxxxxxxxxxx>
>> wrote:
>>>
>>> Can I get the current state of all options (regardless of matching the
>>> default or not)?
>>
>> Your best choice is probably:
>>  set -o
>
> Yea.  That’s better.  I was working on:
>
> ( setopt | sed -e 's/$/ on/' -e 's/^no\(.*\) on$/\1 off/' ; unsetopt | sed
> -e 's/$/ off/' -e 's/^no\(.*\) off$/\1 on/' ) | sort
>
> Since each option is either set to default or not.

A good old trick is:
printf '%s := %s\n' "${(@kv)options}"

-- 
Mikael Magnusson




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