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

Re: [PATCH] don't exit shell on [[ -o invalid@option ]]



Peter Stephenson wrote on Sun, 19 Nov 2017 19:53 +0000:
> On Sun, 19 Nov 2017 11:41:57 -0800
> Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > On Sat, Nov 18, 2017 at 10:22 AM, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> > >
> > > How about the following.
> > >
> > > It uses status 3 because status 2 currently means "syntax error in [["
> > > and I didn't want to overload that; and it uses POSIX_BUILTINS because
> > > that seemed more closely related than POSIX_IDENTIFIERS.
> > 
> > For reasons I can't entirely define, it bothers me that an operation
> > to test the setting of options changes its behavior based on the
> > setting of an option.
> 

Are you concerned about self-reference?  I.e., that code meant to run
under any options (example: z-sy-h) wouldn't be able to test the
settedness of an option using [[ -o foo ]] because the behaviour of
that command depends on whether foo is set?  (That's basically the
Liar Paradox)

I don't think that's a problem in this case, but I'm listening...

> I'm actually more worried if this *isn't* an option, given it's (in a
> more touchy feely sense) optional behaviour.  Having something of that
> kind based on emulation seems a bit gross.  But we do have gross syntax
> changes based on emulation, it's true, such as variables that never
> appear.

I'm quite swamped this week (in a good way) but when I get a chance I'll
finish the patch and push.  (Needs more tests and a README blurb, at least)

Cheers,

Daniel



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