Rename --html-extension to --adjust-extension.

This commit is contained in:
Micah Cowan 2009-07-28 17:37:58 -07:00
parent c784c334d3
commit 9dadbf6fe9
10 changed files with 49 additions and 18 deletions

View File

@ -1,7 +1,8 @@
2009-07-28 Micah Cowan <micah@cowan.name>
* NEWS: Mention some more previously undocumented items, and the
new "ascii" specifer for --restrict-file-names.
* NEWS: Mention some more previously undocumented items, the
new "ascii" specifer for --restrict-file-names, and the renaming
of --html-extension to --adjust-extension.
2009-07-27 Petr Pisar <petr.pisar@atlas.cz>

3
NEWS
View File

@ -41,6 +41,9 @@ an external file.
information on how it was built, and the set of configure-time options
that were selected.
** --html-extension has been renamed to --adjust-extension, to reflect
the fact that it now also applies to CSS content..
** An "ascii" specifier is now accepted by --restrict-file-names, which
forces the percent-encoding of all non-ASCII bytes

View File

@ -2,6 +2,8 @@
* wget.texi (Download Options): Document "lowercase", "uppercase",
and the new "ascii" specifier for --restrict-file-names.
(HTTP Options): Rename --html-extension to --adjust-extension.
(Wgetrc Commands): Rename html_extension to adjust_extension.
2009-07-26 Micah Cowan <micah@cowan.name>

View File

@ -1148,8 +1148,9 @@ Use @var{name} as the default file name when it isn't known (i.e., for
URLs that end in a slash), instead of @file{index.html}.
@cindex .html extension
@cindex .css extension
@item -E
@itemx --html-extension
@itemx --adjust-extension
If a file of type @samp{application/xhtml+xml} or @samp{text/html} is
downloaded and the URL does not end with the regexp
@samp{\.[Hh][Tt][Mm][Ll]?}, this option will cause the suffix @samp{.html}
@ -1170,9 +1171,14 @@ version of the file will be saved as @file{@var{X}.orig} (@pxref{Recursive
Retrieval Options}).
As of version 1.12, Wget will also ensure that any downloaded files of
type @samp{text/css} end in the suffix @samp{.css}. Obviously, this
makes the name @samp{--html-extension} misleading; a better name is
expected to be offered as an alternative in the near future.
type @samp{text/css} end in the suffix @samp{.css}, and the option was
renamed from @samp{--html-extension}, to better reflect its new
behavior. The old option name is still acceptable, but should now be
considered deprecated.
At some point in the future, this option may well be expanded to
include suffixes for other types of content, including content types
that are not parsed by Wget.
@cindex http user
@cindex http password
@ -2264,7 +2270,7 @@ ways, all of which can change whether an accept/reject rule matches:
If the local file already exists and @samp{--no-directories} was
specified, a numeric suffix will be appended to the original name.
@item
If @samp{--html-extension} was specified, the local filename will have
If @samp{--adjust-extension} was specified, the local filename might have
@samp{.html} appended to it. If Wget is invoked with @samp{-E -A.php},
a filename such as @samp{index.php} will match be accepted, but upon
download will be named @samp{index.php.html}, which no longer matches,
@ -2845,10 +2851,12 @@ Turn globbing on/off---the same as @samp{--glob} and @samp{--no-glob}.
Define a header for HTTP downloads, like using
@samp{--header=@var{string}}.
@item html_extension = on/off
@item adjust_extension = on/off
Add a @samp{.html} extension to @samp{text/html} or
@samp{application/xhtml+xml} files without it, or a @samp{.css}
extension to @samp{text/css} files without it, like @samp{-E}.
@samp{application/xhtml+xml} files that lack one, or a @samp{.css}
extension to @samp{text/css} files that lack one, like
@samp{-E}. Previously named @samp{html_extension} (still acceptable,
but deprecated).
@item http_keep_alive = on/off
Turn the keep-alive feature on or off (defaults to on). Turning it

View File

@ -1,3 +1,18 @@
2009-07-28 Micah Cowan <micah@cowan.name>
* main.c (option_data): Rename --html-extension to
--adjust-extension.
(print_help): Ditto.
* options.h (struct option): Rename html_extension to
adjust_extension.
* http.c (gethttp): Ditto.
* convert.c (local_quote_string): Ditto.
* init.c (commands): Add "adjustextension", and reflect rename
change for opt.adjust_extension, for both "adjustextension" and
"htmlextension".
2009-07-27 Micah Cowan <micah@cowan.name>
* options.h (struct options): Added restrict_files_nonascii

View File

@ -591,7 +591,7 @@ find_fragment (const char *beg, int size, const char **bp, const char **ep)
We quote ? as %3F to avoid passing part of the file name as the
parameter when browsing the converted file through HTTP. However,
it is safe to do this only when `--html-extension' is turned on.
it is safe to do this only when `--adjust-extension' is turned on.
This is because converting "index.html?foo=bar" to
"index.html%3Ffoo=bar" would break local browsing, as the latter
isn't even recognized as an HTML file! However, converting
@ -628,7 +628,7 @@ local_quote_string (const char *file)
*to++ = '3';
break;
case '?':
if (opt.html_extension)
if (opt.adjust_extension)
{
*to++ = '%';
*to++ = '3';

View File

@ -2175,10 +2175,10 @@ File %s already there; not retrieving.\n\n"), quote (hs->local_file));
else
*dt &= ~TEXTCSS;
if (opt.html_extension)
if (opt.adjust_extension)
{
if (*dt & TEXTHTML)
/* -E / --html-extension / html_extension = on was specified,
/* -E / --adjust-extension / adjust_extension = on was specified,
and this is a text/html file. If some case-insensitive
variation on ".htm[l]" isn't already the file's suffix,
tack on ".html". */

View File

@ -107,6 +107,7 @@ static const struct {
/* KEEP THIS LIST ALPHABETICALLY SORTED */
{ "accept", &opt.accepts, cmd_vector },
{ "addhostdir", &opt.add_hostdir, cmd_boolean },
{ "adjustextension", &opt.adjust_extension, cmd_boolean },
{ "alwaysrest", &opt.always_rest, cmd_boolean }, /* deprecated */
{ "askpassword", &opt.ask_passwd, cmd_boolean },
{ "authnochallenge", &opt.auth_without_challenge,
@ -163,7 +164,7 @@ static const struct {
{ "ftpuser", &opt.ftp_user, cmd_string },
{ "glob", &opt.ftp_glob, cmd_boolean },
{ "header", NULL, cmd_spec_header },
{ "htmlextension", &opt.html_extension, cmd_boolean },
{ "htmlextension", &opt.adjust_extension, cmd_boolean },
{ "htmlify", NULL, cmd_spec_htmlify },
{ "httpkeepalive", &opt.http_keep_alive, cmd_boolean },
{ "httppasswd", &opt.http_passwd, cmd_string }, /* deprecated */

View File

@ -147,6 +147,7 @@ struct cmdline_option {
static struct cmdline_option option_data[] =
{
{ "accept", 'A', OPT_VALUE, "accept", -1 },
{ "adjust-extension", 'E', OPT_BOOLEAN, "adjustextension", -1 },
{ "append-output", 'a', OPT__APPEND_OUTPUT, NULL, required_argument },
{ "ask-password", 0, OPT_BOOLEAN, "askpassword", -1 },
{ "auth-no-challenge", 0, OPT_BOOLEAN, "authnochallenge", -1 },
@ -195,7 +196,7 @@ static struct cmdline_option option_data[] =
{ "header", 0, OPT_VALUE, "header", -1 },
{ "help", 'h', OPT_FUNCALL, (void *)print_help, no_argument },
{ "host-directories", 0, OPT_BOOLEAN, "addhostdir", -1 },
{ "html-extension", 'E', OPT_BOOLEAN, "htmlextension", -1 },
{ "html-extension", 'E', OPT_BOOLEAN, "adjustextension", -1 },
{ "htmlify", 0, OPT_BOOLEAN, "htmlify", -1 },
{ "http-keep-alive", 0, OPT_BOOLEAN, "httpkeepalive", -1 },
{ "http-passwd", 0, OPT_VALUE, "httppassword", -1 }, /* deprecated */
@ -537,7 +538,7 @@ HTTP options:\n"),
--default-page=NAME Change the default page name (normally\n\
this is `index.html'.).\n"),
N_("\
-E, --html-extension save HTML documents with `.html' extension.\n"),
-E, --adjust-extension save HTML/CSS documents with proper extensions.\n"),
N_("\
--ignore-length ignore `Content-Length' header field.\n"),
N_("\

View File

@ -162,7 +162,7 @@ struct options
bool delete_after; /* Whether the files will be deleted
after download. */
bool html_extension; /* Use ".html" extension on all text/html? */
bool adjust_extension; /* Use ".html" extension on all text/html? */
bool page_requisites; /* Whether we need to download all files
necessary to display a page properly. */