Index | Thread | Search

From:
Jason McIntyre <jmc@kerhand.co.uk>
Subject:
Re: reference glob(7), not fnmatch(3) in utility manuals
To:
tech@openbsd.org
Date:
Tue, 3 Dec 2024 11:16:41 +0000

Download raw body.

Thread
On Fri, Nov 29, 2024 at 12:07:09PM -0800, Evan Silberman wrote:
> User utilities supporting glob(7) patterns should refer to that manual,
> rather than fnmatch(3), which doesn't actually document the pattern
> language.
> 
> file + usr.bin/tmux/tmux.1
> --- usr.bin/tmux/tmux.1
> +++ usr.bin/tmux/tmux.1
> @@ -760,7 +760,7 @@ would match a session named
>  .Ql mysession .
>  .It
>  An
> -.Xr fnmatch 3
> +.Xr glob 7
>  pattern which is matched against the session name.
>  .El
>  .Pp
> @@ -808,8 +808,8 @@ An exact window name, such as
>  The start of a window name, such as
>  .Ql mysession:mywin .
>  .It
> -As an
> -.Xr fnmatch 3
> +As a
> +.Xr glob 7
>  pattern matched against the window name.
>  .El
>  .Pp
> @@ -2859,7 +2859,7 @@ other commands are not blocked from running until the 
>  .Xc
>  .D1 Pq alias: Ic findw
>  Search for a
> -.Xr fnmatch 3
> +.Xr glob 7
>  pattern or, with
>  .Fl r ,
>  regular expression
> @@ -4230,8 +4230,8 @@ supports.
>  .Pp
>  This is an array option where each entry is a colon-separated string made up
>  of a terminal type pattern (matched using
> -.Xr fnmatch 3 )
> -followed by a list of terminal features.
> +.Xr glob 7
> +patterns) followed by a list of terminal features.
>  The available features are:
>  .Bl -tag -width Ds
>  .It 256
> @@ -4287,7 +4287,8 @@ Allow terminal descriptions read using
>  to be overridden.
>  Each entry is a colon-separated string made up of a terminal type pattern
>  (matched using
> -.Xr fnmatch 3 )
> +.Xr glob 7
> +patterns)
>  and a set of
>  .Em name=value
>  entries.
> @@ -5625,14 +5626,14 @@ true, for example
>  .Pp
>  An
>  .Ql m
> -specifies an
> -.Xr fnmatch 3
> +specifies a
> +.Xr glob 7
>  or regular expression comparison.

i changed this to "glob(7) pattern", since that matched the other
references.

jmc

>  The first argument is the pattern and the second the string to compare.
>  An optional argument specifies flags:
>  .Ql r
>  means the pattern is a regular expression instead of the default
> -.Xr fnmatch 3
> +.Xr glob 7
>  pattern, and
>  .Ql i
>  means to ignore case.
> @@ -5643,7 +5644,7 @@ or
>  A
>  .Ql C
>  performs a search for an
> -.Xr fnmatch 3
> +.Xr glob 7
>  pattern or regular expression in the pane content and evaluates to zero if not
>  found, or a line number if found.
>  Like
>