From 96418c68851d00fd66014d2dc7bd46b3d715e525 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 6 Jun 2012 14:10:07 +0200 Subject: [PATCH] Rename --bits to --report-bps. --- NEWS | 2 +- src/ChangeLog | 10 ++++++++++ src/init.c | 2 +- src/main.c | 4 ++-- src/options.h | 2 +- src/progress.c | 2 +- src/retr.c | 4 ++-- src/utils.c | 4 ++-- 8 files changed, 20 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index ba67de97..20123a2b 100644 --- a/NEWS +++ b/NEWS @@ -21,7 +21,7 @@ Please send GNU Wget bug reports to . ** Report stdout close errors. -** Accept the --bit option. +** Accept the --report-bps option. ** Enable client certificates when GNU TLS is used. diff --git a/src/ChangeLog b/src/ChangeLog index c91af04d..e8c6ba49 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2012-06-06 Giuseppe Scrivano + + * 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 * main.c (main): Check for filename != NULL. diff --git a/src/init.c b/src/init.c index 57a4f00d..b55aa968 100644 --- a/src/init.c +++ b/src/init.c @@ -133,7 +133,6 @@ static const struct { { "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 @@ -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 }, + { "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 }, diff --git a/src/main.c b/src/main.c index dda91c72..5e87f733 100644 --- a/src/main.c +++ b/src/main.c @@ -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 }, - { "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 }, @@ -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 }, + { "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 }, @@ -764,7 +764,7 @@ Recursive accept/reject:\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 .\n") }; diff --git a/src/options.h b/src/options.h index 0da79379..44e0a703 100644 --- a/src/options.h +++ b/src/options.h @@ -279,7 +279,7 @@ struct options 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; diff --git a/src/progress.c b/src/progress.c index f61c95e5..2e888a90 100644 --- a/src/progress.c +++ b/src/progress.c @@ -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, - 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 diff --git a/src/retr.c b/src/retr.c index 8bc54425..6204839c 100644 --- a/src/retr.c +++ b/src/retr.c @@ -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, - dlrate, !opt.bits_fmt? rate_names[units]: rate_names_bits[units]); + dlrate, !opt.report_bps ? rate_names[units]: rate_names_bits[units]); return res; } @@ -647,7 +647,7 @@ calc_rate (wgint bytes, double secs, int *units) double dlrate; double bibyte = 1000.0; - if (!opt.bits_fmt) + if (!opt.report_bps) bibyte = 1024.0; diff --git a/src/utils.c b/src/utils.c index fb3ccd45..567dc359 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1844,12 +1844,12 @@ number_to_static_string (wgint number) 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) { - if (opt.bits_fmt) + if (opt.report_bps) return num * 8; return num; } -- 2.39.2