Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] docs: clarify Yn globqual explanation
- X-seq: zsh-workers 53808
- From: dana <dana@xxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] docs: clarify Yn globqual explanation
- Date: Tue, 01 Jul 2025 18:10:44 -0500
- Archived-at: <https://zsh.org/workers/53808>
- Feedback-id: i9be146f9:Fastmail
- List-id: <zsh-workers.zsh.org>
the documentation for the Yn glob qualifier says:
> enables short-circuit mode: the pattern will expand to at most n
> filenames. If more than n matches exist, only the first n matches in
> directory traversal order will be considered.
>
> Implies oN when no oc qualifier is used.
this is accurate but it feels confusing to me -- like it could suggest
that it will *not* return matches in traversal order and instead use the
one specified by a sorting qualifier if given. but that's not the case
maybe this is clearer
dana
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index 2dc69eb1e..445a15448 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -3099,7 +3099,9 @@ enables short-circuit mode: the pattern will expand to at most var(n)
filenames. If more than var(n) matches exist, only the first var(n)
matches in directory traversal order will be considered.
-Implies tt(oN) when no tt(o)var(c) qualifier is used.
+Any sorting specified with an tt(o)var(c) or tt(O)var(c) qualifier is
+applied em(after) the var(n) matches are returned; tt(oN) is implied
+otherwise.
)
item(tt(o)var(c))(
specifies how the names of the files should be sorted. The following values
Messages sorted by:
Reverse Date,
Date,
Thread,
Author