* "no_nomatch" and glob qualifiers
@ 2015-10-05 22:22 Bart Schaefer
2015-10-05 23:47 ` Mikael Magnusson
0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2015-10-05 22:22 UTC (permalink / raw)
To: zsh-workers
Consider:
% setopt nonomatch
% echo x(/)
x(/)
% echo x(a)
zsh: number expected
%
Should that not have output "x(a)" ?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: "no_nomatch" and glob qualifiers
2015-10-05 22:22 "no_nomatch" and glob qualifiers Bart Schaefer
@ 2015-10-05 23:47 ` Mikael Magnusson
2015-10-06 7:49 ` Bart Schaefer
0 siblings, 1 reply; 3+ messages in thread
From: Mikael Magnusson @ 2015-10-05 23:47 UTC (permalink / raw)
To: Bart Schaefer; +Cc: zsh workers
On Tue, Oct 6, 2015 at 12:22 AM, Bart Schaefer
<schaefer@brasslantern.com> wrote:
> Consider:
>
> % setopt nonomatch
> % echo x(/)
> x(/)
> % echo x(a)
> zsh: number expected
> %
>
> Should that not have output "x(a)" ?
I feel like there is a difference between "this is a valid glob that
has no matches" and "this is a syntax error", and this is that
difference.
% echo a(
>
also doesn't "work".
--
Mikael Magnusson
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: "no_nomatch" and glob qualifiers
2015-10-05 23:47 ` Mikael Magnusson
@ 2015-10-06 7:49 ` Bart Schaefer
0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2015-10-06 7:49 UTC (permalink / raw)
To: zsh workers
On Oct 6, 1:47am, Mikael Magnusson wrote:
}
} > % echo x(a)
} > zsh: number expected
} >
} > Should that not have output "x(a)" ?
}
} I feel like there is a difference between "this is a valid glob that
} has no matches" and "this is a syntax error", and this is that
} difference.
If that were it then nobadpattern should fix it, yet for qualifiers it
still fails.
% setopt nonomatch nobadpattern
% echo x(z)
zsh: unknown file attribute: z
%
But on the other hand:
% unsetopt nobadpattern
% echo x(,)
x(,)
%
} % echo a(
} >
}
} also doesn't "work".
Close the paren and you get
zsh: unknown file attribute: \n
I can counter-example that one, too:
% echo x(:
> )
x(:
)
%
A missing numeric argument is an error, but an invalid colon-modifier
is not?
(I'm not really arguing that we should change anything, unless somebody
is convinced by this discussion that I should be.)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-06 7:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-05 22:22 "no_nomatch" and glob qualifiers Bart Schaefer
2015-10-05 23:47 ` Mikael Magnusson
2015-10-06 7:49 ` Bart Schaefer
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).