From 6b5c0c742d251dd299ad46b43ea6bb576b7b8997 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 6 Jun 2012 20:41:25 +0200 Subject: [PATCH] Rename, again, --reports-bits to report-speed. --- NEWS | 2 +- src/ChangeLog | 6 ++++++ src/init.c | 12 +++++++++++- src/main.c | 4 ++-- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 20123a2b..3742159c 100644 --- a/NEWS +++ b/NEWS @@ -21,7 +21,7 @@ Please send GNU Wget bug reports to . ** Report stdout close errors. -** Accept the --report-bps option. +** Accept the --report-speed option. ** Enable client certificates when GNU TLS is used. diff --git a/src/ChangeLog b/src/ChangeLog index e8c6ba49..fb352ad3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,9 +1,15 @@ 2012-06-06 Giuseppe Scrivano + * 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 + * progress.c (create_image): Adjust caller. * retr.c (retr_rate): Likewise. * utils.c (convert_to_bits): Likewise. diff --git a/src/init.c b/src/init.c index b55aa968..d5f9a4f0 100644 --- a/src/init.c +++ b/src/init.c @@ -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_report_speed); #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 }, - { "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 }, @@ -1451,6 +1452,15 @@ cmd_spec_restrict_file_names (const char *com, const char *val, void *place_igno 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) diff --git a/src/main.c b/src/main.c index 5e87f733..e5a60e66 100644 --- a/src/main.c +++ b/src/main.c @@ -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 }, - { "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 }, @@ -764,7 +764,7 @@ Recursive accept/reject:\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 .\n") }; -- 2.39.2