** Report stdout close errors.
-** Accept the --report-bps option.
+** Accept the --report-speed option.
** Enable client certificates when GNU TLS is used.
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
+
* progress.c (create_image): Adjust caller.
* retr.c (retr_rate): Likewise.
* utils.c (convert_to_bits): Likewise.
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
{ "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 },
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)
{ "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 },
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")
};