]> sjero.net Git - wget/commitdiff
Rename, again, --reports-bits to report-speed.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Wed, 6 Jun 2012 18:41:25 +0000 (20:41 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Wed, 6 Jun 2012 18:41:25 +0000 (20:41 +0200)
NEWS
src/ChangeLog
src/init.c
src/main.c

diff --git a/NEWS b/NEWS
index 20123a2b09debb4a39a55ad1c069affca152d258..3742159c79f0c84e3f3171b127335d4c551fd741 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -21,7 +21,7 @@ Please send GNU Wget bug reports to <bug-wget@gnu.org>.
 
 ** Report stdout close errors.
 
 
 ** Report stdout close errors.
 
-** Accept the --report-bps option.
+** Accept the --report-speed option.
 
 ** Enable client certificates when GNU TLS is used.
 
 
 ** Enable client certificates when GNU TLS is used.
 
index e8c6ba49dc58060a4356600e7b1430c9e4406761..fb352ad3ce228e9313fdd069c5b5d9f5e80b3fe7 100644 (file)
@@ -1,9 +1,15 @@
 2012-06-06  Giuseppe Scrivano  <gscrivano@gnu.org>
 
 2012-06-06  Giuseppe Scrivano  <gscrivano@gnu.org>
 
+       * main.c (print_help): Rename --bits to --report-bps.
+       (cmdline_options): Likewise.
+       * init.c (commands): Rename --report-bps to --report-speed.
+       (cmd_spec_report_speed): New function.
+
        * options.h (struct options): Rename `bits_fmt' to `report_bps'.
        * main.c (print_help): Rename --bits to --report-bps.
        (cmdline_options): Likewise.
        * init.c (commands): Likewise
        * options.h (struct options): Rename `bits_fmt' to `report_bps'.
        * main.c (print_help): Rename --bits to --report-bps.
        (cmdline_options): Likewise.
        * init.c (commands): Likewise
+
        * progress.c (create_image): Adjust caller.
        * retr.c (retr_rate): Likewise.
        * utils.c (convert_to_bits): Likewise.
        * progress.c (create_image): Adjust caller.
        * retr.c (retr_rate): Likewise.
        * utils.c (convert_to_bits): Likewise.
index b55aa968af14623d7854f38c6edc6c9524a8abf4..d5f9a4f09bdb9c0d447a59b0333df96a59555915 100644 (file)
@@ -100,6 +100,7 @@ CMD_DECLARE (cmd_spec_progress);
 CMD_DECLARE (cmd_spec_recursive);
 CMD_DECLARE (cmd_spec_regex_type);
 CMD_DECLARE (cmd_spec_restrict_file_names);
 CMD_DECLARE (cmd_spec_recursive);
 CMD_DECLARE (cmd_spec_regex_type);
 CMD_DECLARE (cmd_spec_restrict_file_names);
+CMD_DECLARE (cmd_spec_report_speed);
 #ifdef HAVE_SSL
 CMD_DECLARE (cmd_spec_secure_protocol);
 #endif
 #ifdef HAVE_SSL
 CMD_DECLARE (cmd_spec_secure_protocol);
 #endif
@@ -247,7 +248,7 @@ static const struct {
   { "relativeonly",     &opt.relative_only,     cmd_boolean },
   { "remoteencoding",   &opt.encoding_remote,   cmd_string },
   { "removelisting",    &opt.remove_listing,    cmd_boolean },
   { "relativeonly",     &opt.relative_only,     cmd_boolean },
   { "remoteencoding",   &opt.encoding_remote,   cmd_string },
   { "removelisting",    &opt.remove_listing,    cmd_boolean },
-  { "reportbps",             &opt.report_bps,          cmd_boolean},
+  { "reportspeed",             &opt.report_bps, cmd_spec_report_speed},
   { "restrictfilenames", NULL,                  cmd_spec_restrict_file_names },
   { "retrsymlinks",     &opt.retr_symlinks,     cmd_boolean },
   { "retryconnrefused", &opt.retry_connrefused, cmd_boolean },
   { "restrictfilenames", NULL,                  cmd_spec_restrict_file_names },
   { "retrsymlinks",     &opt.retr_symlinks,     cmd_boolean },
   { "retryconnrefused", &opt.retry_connrefused, cmd_boolean },
@@ -1451,6 +1452,15 @@ cmd_spec_restrict_file_names (const char *com, const char *val, void *place_igno
   return true;
 }
 
   return true;
 }
 
+static bool
+cmd_spec_report_speed (const char *com, const char *val, void *place_ignored)
+{
+  opt.report_bps = strcasecmp (val, "bits") == 0;
+  if (!opt.report_bps)
+    fprintf (stderr, _("%s: %s: Invalid value %s.\n"), exec_name, com, quote (val));
+  return opt.report_bps;
+}
+
 #ifdef HAVE_SSL
 static bool
 cmd_spec_secure_protocol (const char *com, const char *val, void *place)
 #ifdef HAVE_SSL
 static bool
 cmd_spec_secure_protocol (const char *com, const char *val, void *place)
index 5e87f73310486699e7d2cb7a8e4296197eb45c7b..e5a60e66c06ae6dad274b4549e8fb599e52cf9e3 100644 (file)
@@ -268,7 +268,7 @@ static struct cmdline_option option_data[] =
     { "relative", 'L', OPT_BOOLEAN, "relativeonly", -1 },
     { "remote-encoding", 0, OPT_VALUE, "remoteencoding", -1 },
     { "remove-listing", 0, OPT_BOOLEAN, "removelisting", -1 },
     { "relative", 'L', OPT_BOOLEAN, "relativeonly", -1 },
     { "remote-encoding", 0, OPT_VALUE, "remoteencoding", -1 },
     { "remove-listing", 0, OPT_BOOLEAN, "removelisting", -1 },
-    { "report-bps", 0, OPT_BOOLEAN, "reportbps", -1 },
+    { "report-speed", 0, OPT_BOOLEAN, "reportspeed", -1 },
     { "restrict-file-names", 0, OPT_BOOLEAN, "restrictfilenames", -1 },
     { "retr-symlinks", 0, OPT_BOOLEAN, "retrsymlinks", -1 },
     { "retry-connrefused", 0, OPT_BOOLEAN, "retryconnrefused", -1 },
     { "restrict-file-names", 0, OPT_BOOLEAN, "restrictfilenames", -1 },
     { "retr-symlinks", 0, OPT_BOOLEAN, "retrsymlinks", -1 },
     { "retry-connrefused", 0, OPT_BOOLEAN, "retryconnrefused", -1 },
@@ -764,7 +764,7 @@ Recursive accept/reject:\n"),
     N_("\
 Output format:\n"),
     N_("\
     N_("\
 Output format:\n"),
     N_("\
-       --report-bps                      Output bandwidth in bits.\n"),
+       --report-speed=TYPE        Output bandwidth as TYPE.  TYPE can be bits.\n"),
     "\n",
     N_("Mail bug reports and suggestions to <bug-wget@gnu.org>.\n")
   };
     "\n",
     N_("Mail bug reports and suggestions to <bug-wget@gnu.org>.\n")
   };