summary refs log tree commit diff
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/Zsh/expn.yo12
-rw-r--r--Doc/Zsh/options.yo15
2 files changed, 27 insertions, 0 deletions
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index 5ea8610f2..20e0c8d35 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -2381,6 +2381,18 @@ follow symbolic links; the alternative form `tt(***/)' does, but is
 otherwise identical.  Neither of these can be combined with other forms of
 globbing within the same path segment; in that case, the `tt(*)'
 operators revert to their usual effect.
+
+Even shorter forms are available when the option tt(GLOB_STAR_SHORT) is
+set.  In that case if no tt(/) immediately follows a tt(**) or tt(***)
+they are treated as if both a tt(/) plus a further tt(*) are present.
+Hence:
+
+example(setopt GLOBSTARSHORT
+ls **.c)
+
+is equivalent to
+
+example(ls **/*.c)
 subsect(Glob Qualifiers)
 cindex(globbing, qualifiers)
 cindex(qualifiers, globbing)
diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo
index fbf65abbc..60379cabc 100644
--- a/Doc/Zsh/options.yo
+++ b/Doc/Zsh/options.yo
@@ -534,6 +534,21 @@ cindex(globbing, of . files)
 item(tt(GLOB_DOTS) (tt(-4)))(
 Do not require a leading `tt(.)' in a filename to be matched explicitly.
 )
+pindex(GLOB_STAR_SHORT)
+pindex(NO_GLOB_STAR_SHORT)
+pindex(GLOBSTARSHORT)
+pindex(NOGLOBSTARSHORT)
+cindex(globbing, short forms)
+cindex(globbing, ** special)
+item(tt(GLOB_STAR_SHORT))(
+When this option is set and the default zsh-style globbing is in
+effect, the pattern `tt(**/*)' can be abbreviated to `tt(**)' and the
+pattern `tt(***/*)' can be abbreviated to tt(***).  Hence `tt(**.c)'
+finds a file ending in tt(.c) in any subdirectory, and `tt(***.c)' does
+the same while also following symbolic links.  A tt(/) immediately
+after the `tt(**)' or `tt(***)' forces the pattern to be treated as the
+unabbreviated form.
+)
 pindex(GLOB_SUBST)
 pindex(NO_GLOB_SUBST)
 pindex(GLOBSUBST)