> > What do you think how we can help novices ?
> > Maybe we should explicitely warn in the docs of -A/-R about shell wildcard
> > expansion ?
> 
> The manual contains the following:
> 
> Recursive Accept/Reject Options
>        -A acclist --accept acclist
>        -R rejlist --reject rejlist
>            Specify comma-separated lists of file name suffixes or
> patterns to accept or reject. Note that if any of
>            the wildcard characters, *, ?, [ or ], appear in an element
> of acclist or rejlist, it will be treated as a
>            pattern, rather than a suffix.
> 
> Perhaps explanation of the need to enclose regular expressions within
> quotation marks should be added?
> 
> Similarly,
> 
> --ignore-case
>            Ignore case when matching files and directories.  This
> influences the behavior of -R, -A, -I, and -X
>            options, as well as globbing implemented when downloading
> from FTP sites.  For example, with this option,
>            -A *.txt will match file1.txt, but also file2.TXT,
> file3.TxT, and so on.
> 
> does not show the use of quotation marks.

A patch is attached.

Thanks for pointing that out.

Tim
>From 29ccc2c6ca13321c2264513adf25f2f078487402 Mon Sep 17 00:00:00 2001
From: Tim Ruehsen <[email protected]>
Date: Sun, 6 Oct 2013 21:45:31 +0200
Subject: [PATCH] add/explain quoting of wildcard patterns in wget.texi

---
 doc/ChangeLog | 4 ++++
 doc/wget.texi | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/doc/ChangeLog b/doc/ChangeLog
index 862b6f3..3b05756 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,7 @@
+2013-10-06  Tim Ruehsen  <[email protected]>
+
+	* wget.texi: add/explain quoting of wildcard patterns
+
 2013-09-04  Tim Ruehsen  <[email protected]>
 
 	* sample.wgetrc: added "secureprotocol" example
diff --git a/doc/wget.texi b/doc/wget.texi
index 0b86775..4a1f7f1 100644
--- a/doc/wget.texi
+++ b/doc/wget.texi
@@ -2071,6 +2071,8 @@ accept or reject (@pxref{Types of Files}). Note that if
 any of the wildcard characters, @samp{*}, @samp{?}, @samp{[} or
 @samp{]}, appear in an element of @var{acclist} or @var{rejlist},
 it will be treated as a pattern, rather than a suffix.
+In this case, you have to enclose the pattern into quotes to prevent
+your shell from expanding it, like in @samp{-A "*.mp3"} or @samp{-A '*.mp3'}.
 
 @item --accept-regex @var{urlregex}
 @itemx --reject-regex @var{urlregex}
@@ -2128,8 +2130,10 @@ dedicated @samp{--page-requisites} option.
 Ignore case when matching files and directories.  This influences the
 behavior of -R, -A, -I, and -X options, as well as globbing
 implemented when downloading from FTP sites.  For example, with this
-option, @samp{-A *.txt} will match @samp{file1.txt}, but also
+option, @samp{-A "*.txt"} will match @samp{file1.txt}, but also
 @samp{file2.TXT}, @samp{file3.TxT}, and so on.
+The quotes in the example are to prevent the shell from expanding the
+pattern.
 
 @item -H
 @itemx --span-hosts
-- 
1.8.4.rc3

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to