]> sjero.net Git - wget/commitdiff
Rename --bits to --report-bps.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Wed, 6 Jun 2012 12:10:07 +0000 (14:10 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Wed, 6 Jun 2012 12:10:07 +0000 (14:10 +0200)
NEWS
src/ChangeLog
src/init.c
src/main.c
src/options.h
src/progress.c
src/retr.c
src/utils.c

diff --git a/NEWS b/NEWS
index ba67de97e5fcefc3eafdac92542d64f9ca0d4211..20123a2b09debb4a39a55ad1c069affca152d258 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 --bit option.
+** Accept the --report-bps option.
 
 ** Enable client certificates when GNU TLS is used.
 
 
 ** Enable client certificates when GNU TLS is used.
 
index c91af04d569675cfa60e95d3a2b0b7ff987f3b28..e8c6ba49dc58060a4356600e7b1430c9e4406761 100644 (file)
@@ -1,3 +1,13 @@
+2012-06-06  Giuseppe Scrivano  <gscrivano@gnu.org>
+
+       * 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.
+
 2012-06-04  Tim Ruehsen  <tim.ruehsen@gmx.de>
 
        * main.c (main): Check for filename != NULL.
 2012-06-04  Tim Ruehsen  <tim.ruehsen@gmx.de>
 
        * main.c (main): Check for filename != NULL.
index 57a4f00d3579b284b1e93dba706dbc29830446e4..b55aa968af14623d7854f38c6edc6c9524a8abf4 100644 (file)
@@ -133,7 +133,6 @@ static const struct {
   { "backups",          &opt.backups,           cmd_number },
   { "base",             &opt.base_href,         cmd_string },
   { "bindaddress",      &opt.bind_address,      cmd_string },
   { "backups",          &opt.backups,           cmd_number },
   { "base",             &opt.base_href,         cmd_string },
   { "bindaddress",      &opt.bind_address,      cmd_string },
-  { "bits",             &opt.bits_fmt,          cmd_boolean},
 #ifdef HAVE_SSL
   { "cacertificate",    &opt.ca_cert,           cmd_file },
 #endif
 #ifdef HAVE_SSL
   { "cacertificate",    &opt.ca_cert,           cmd_file },
 #endif
@@ -248,6 +247,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},
   { "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 },
index dda91c72f9c6dc78edaef8e99db1c1a439c062a2..5e87f73310486699e7d2cb7a8e4296197eb45c7b 100644 (file)
@@ -168,7 +168,6 @@ static struct cmdline_option option_data[] =
     { "backups", 0, OPT_BOOLEAN, "backups", -1 },
     { "base", 'B', OPT_VALUE, "base", -1 },
     { "bind-address", 0, OPT_VALUE, "bindaddress", -1 },
     { "backups", 0, OPT_BOOLEAN, "backups", -1 },
     { "base", 'B', OPT_VALUE, "base", -1 },
     { "bind-address", 0, OPT_VALUE, "bindaddress", -1 },
-    { "bits", 0, OPT_BOOLEAN, "bits", -1 },
     { IF_SSL ("ca-certificate"), 0, OPT_VALUE, "cacertificate", -1 },
     { IF_SSL ("ca-directory"), 0, OPT_VALUE, "cadirectory", -1 },
     { "cache", 0, OPT_BOOLEAN, "cache", -1 },
     { IF_SSL ("ca-certificate"), 0, OPT_VALUE, "cacertificate", -1 },
     { IF_SSL ("ca-directory"), 0, OPT_VALUE, "cadirectory", -1 },
     { "cache", 0, OPT_BOOLEAN, "cache", -1 },
@@ -269,6 +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 },
     { "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_("\
-       --bits                      Output bandwidth in bits.\n"),
+       --report-bps                      Output bandwidth in 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")
   };
index 0da793798daf1369b7c55da7c83edb94450ed062..44e0a703c0b55e60f2c447579f983512e5070510 100644 (file)
@@ -279,7 +279,7 @@ struct options
 
   bool show_all_dns_entries; /* Show all the DNS entries when resolving a
                                 name. */
 
   bool show_all_dns_entries; /* Show all the DNS entries when resolving a
                                 name. */
-  bool bits_fmt;              /*Output bandwidth in bits format*/
+  bool report_bps;              /*Output bandwidth in bits format*/
 };
 
 extern struct options opt;
 };
 
 extern struct options opt;
index f61c95e5bb981ace0b202223a1b5a14b4574cc82..2e888a90b42a722fbf479bb7a6084f61afce79b4 100644 (file)
@@ -989,7 +989,7 @@ create_image (struct bar_progress *bp, double dl_total_time, bool done)
       double dltime = hist->total_time + (dl_total_time - bp->recent_start);
       double dlspeed = calc_rate (dlquant, dltime, &units);
       sprintf (p, " %4.*f%s", dlspeed >= 99.95 ? 0 : dlspeed >= 9.995 ? 1 : 2,
       double dltime = hist->total_time + (dl_total_time - bp->recent_start);
       double dlspeed = calc_rate (dlquant, dltime, &units);
       sprintf (p, " %4.*f%s", dlspeed >= 99.95 ? 0 : dlspeed >= 9.995 ? 1 : 2,
-               dlspeed,  !opt.bits_fmt?short_units[units]:short_units_bits[units]);
+               dlspeed,  !opt.report_bps ? short_units[units] : short_units_bits[units]);
       move_to_end (p);
     }
   else
       move_to_end (p);
     }
   else
index 8bc544257044d5892138a8fac836b5d35a56f1d7..6204839c62c4b331b4a80d0c731ee3fd18134d5e 100644 (file)
@@ -628,7 +628,7 @@ retr_rate (wgint bytes, double secs)
      e.g. "1022", "247", "12.5", "2.38".  */
   sprintf (res, "%.*f %s",
            dlrate >= 99.95 ? 0 : dlrate >= 9.995 ? 1 : 2,
      e.g. "1022", "247", "12.5", "2.38".  */
   sprintf (res, "%.*f %s",
            dlrate >= 99.95 ? 0 : dlrate >= 9.995 ? 1 : 2,
-           dlrate, !opt.bits_fmt? rate_names[units]: rate_names_bits[units]);
+           dlrate, !opt.report_bps ? rate_names[units]: rate_names_bits[units]);
 
   return res;
 }
 
   return res;
 }
@@ -647,7 +647,7 @@ calc_rate (wgint bytes, double secs, int *units)
   double dlrate;
   double bibyte = 1000.0;
  
   double dlrate;
   double bibyte = 1000.0;
  
-  if (!opt.bits_fmt)
+  if (!opt.report_bps)
     bibyte = 1024.0;
 
 
     bibyte = 1024.0;
 
 
index fb3ccd451671350360213f05a575963626f986c6..567dc359eeaa94e2a674ae92e70ea3d80bfa4c15 100644 (file)
@@ -1844,12 +1844,12 @@ number_to_static_string (wgint number)
   return buf;
 }
 
   return buf;
 }
 
-/* Converts the byte to bits format if --bits option is enabled
+/* Converts the byte to bits format if --report-bps option is enabled
  */
 wgint
 convert_to_bits (wgint num)
 {
  */
 wgint
 convert_to_bits (wgint num)
 {
-  if (opt.bits_fmt)
+  if (opt.report_bps)
     return num * 8;
   return num;
 }
     return num * 8;
   return num;
 }