From: Micah Cowan Date: Wed, 29 Jul 2009 00:37:58 +0000 (-0700) Subject: Rename --html-extension to --adjust-extension. X-Git-Tag: v1.13~286 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=9dadbf6fe9577a6a6b7e7bab4e4b782fc1a6f86c Rename --html-extension to --adjust-extension. --- diff --git a/ChangeLog b/ChangeLog index 1eeb63ca..3c5caec9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,8 @@ 2009-07-28 Micah Cowan - * 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 diff --git a/NEWS b/NEWS index df2c7742..559558e7 100644 --- a/NEWS +++ b/NEWS @@ -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 diff --git a/doc/ChangeLog b/doc/ChangeLog index d5494fa2..21cd03fd 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -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 diff --git a/doc/wget.texi b/doc/wget.texi index aab1a890..ee7a873c 100644 --- a/doc/wget.texi +++ b/doc/wget.texi @@ -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 diff --git a/src/ChangeLog b/src/ChangeLog index afac4339..f53b6d49 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,18 @@ +2009-07-28 Micah Cowan + + * 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 * options.h (struct options): Added restrict_files_nonascii diff --git a/src/convert.c b/src/convert.c index 280d1b0c..71e3d8f0 100644 --- a/src/convert.c +++ b/src/convert.c @@ -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'; diff --git a/src/http.c b/src/http.c index 311cb972..d24db5fc 100644 --- a/src/http.c +++ b/src/http.c @@ -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". */ diff --git a/src/init.c b/src/init.c index 5a4bbe50..4e16d1fe 100644 --- a/src/init.c +++ b/src/init.c @@ -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 */ diff --git a/src/main.c b/src/main.c index 4616b063..5c0b3315 100644 --- a/src/main.c +++ b/src/main.c @@ -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_("\ diff --git a/src/options.h b/src/options.h index cc0d20e6..8afa2523 100644 --- a/src/options.h +++ b/src/options.h @@ -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. */