Blob Blame History Raw
From 44ba49b31f4ea515f8a6ef2642a34c0fd2024b90 Mon Sep 17 00:00:00 2001
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Tue, 9 Jul 2013 00:50:30 +0200
Subject: [PATCH] doc: document --backups

---
 doc/wget.texi | 15 ++++++++++++---
 src/main.c    |  3 +++
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/doc/wget.texi b/doc/wget.texi
index 5054382..7a1670e 100644
--- a/doc/wget.texi
+++ b/doc/wget.texi
@@ -630,6 +630,13 @@ Note that when @samp{-nc} is specified, files with the suffixes
 @samp{.html} or @samp{.htm} will be loaded from the local disk and
 parsed as if they had been retrieved from the Web.
 
+@cindex backing up files
+@item --backups=@var{backups}
+Before (over)writing a file, back up an existing file by adding a
+@samp{.1} suffix (@samp{_1} on VMS) to the file name.  Such backup
+files are rotated to @samp{.2}, @samp{.3}, and so on, up to
+@var{backups} (and lost beyond that).
+
 @cindex continue retrieval
 @cindex incomplete downloads
 @cindex resume download
@@ -2882,9 +2889,11 @@ enables it).
 Enable/disable saving pre-converted files with the suffix
 @samp{.orig}---the same as @samp{-K} (which enables it).
 
-@c @item backups = @var{number}
-@c #### Document me!
-@c
+@item backups = @var{number}
+Use up to @var{number} backups for a file.  Backups are rotated by
+adding an incremental counter that starts at @samp{1}.  The default is
+@samp{0}.
+
 @item base = @var{string}
 Consider relative @sc{url}s in input files (specified via the
 @samp{input} command or the @samp{--input-file}/@samp{-i} option,
diff --git a/src/main.c b/src/main.c
index c895c4e..8ce0eb3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -714,6 +714,9 @@ Recursive download:\n"),
     N_("\
   -k,  --convert-links      make links in downloaded HTML or CSS point to\n\
                             local files.\n"),
+    N_("\
+  --backups=N   before writing file X, rotate up to N backup files.\n"),
+
 #ifdef __VMS
     N_("\
   -K,  --backup-converted   before converting file X, back up as X_orig.\n"),
-- 
1.8.3.1