X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fmain.c;h=3d99a1efe16939828632ae8191897ac6a6496067;hp=3ce7583f268b1347ead5208a4817b095ffc76ffe;hb=8c2fd06ba80b5312b4540859d452664450ec054f;hpb=d68295bdb1571589698ecd0f887f4ba6b72e4d30 diff --git a/src/main.c b/src/main.c index 3ce7583f..3d99a1ef 100644 --- a/src/main.c +++ b/src/main.c @@ -247,6 +247,7 @@ static struct cmdline_option option_data[] = { IF_SSL ("private-key"), 0, OPT_VALUE, "privatekey", -1 }, { IF_SSL ("private-key-type"), 0, OPT_VALUE, "privatekeytype", -1 }, { "progress", 0, OPT_VALUE, "progress", -1 }, + { "show-progress", 0, OPT_BOOLEAN, "showprogress", -1 }, { "protocol-directories", 0, OPT_BOOLEAN, "protocoldirectories", -1 }, { "proxy", 0, OPT_BOOLEAN, "useproxy", -1 }, { "proxy__compat", 'Y', OPT_VALUE, "useproxy", -1 }, /* back-compatible */ @@ -276,6 +277,7 @@ static struct cmdline_option option_data[] = { "server-response", 'S', OPT_BOOLEAN, "serverresponse", -1 }, { "span-hosts", 'H', OPT_BOOLEAN, "spanhosts", -1 }, { "spider", 0, OPT_BOOLEAN, "spider", -1 }, + { "start-pos", 0, OPT_VALUE, "startpos", -1 }, { "strict-comments", 0, OPT_BOOLEAN, "strictcomments", -1 }, { "timeout", 'T', OPT_VALUE, "timeout", -1 }, { "timestamping", 'N', OPT_BOOLEAN, "timestamping", -1 }, @@ -315,7 +317,7 @@ static struct cmdline_option option_data[] = static char * no_prefix (const char *s) { - static char buffer[1024]; + static char buffer[2048]; static char *p = buffer; char *cp = p; @@ -485,8 +487,12 @@ Download:\n"), existing files (overwriting them).\n"), N_("\ -c, --continue resume getting a partially-downloaded file.\n"), + N_("\ + --start-pos=OFFSET start downloading from zero-based position OFFSET.\n"), N_("\ --progress=TYPE select progress gauge type.\n"), + N_("\ + --show-progress display the progress bar in any verbosity mode.\n"), N_("\ -N, --timestamping don't re-retrieve files unless newer than\n\ local.\n"), @@ -1215,6 +1221,7 @@ main (int argc, char **argv) /* All user options have now been processed, so it's now safe to do interoption dependency checks. */ + if (opt.noclobber && opt.convert_links) { fprintf (stderr, @@ -1242,6 +1249,8 @@ main (int argc, char **argv) if (opt.verbose == -1) opt.verbose = !opt.quiet; + if (opt.verbose == 1) + opt.show_progress = true; /* Sanity checks. */ if (opt.verbose && opt.quiet) @@ -1323,12 +1332,13 @@ for details.\n\n")); _("WARC output does not work with --spider.\n")); exit (1); } - if (opt.always_rest) + if (opt.always_rest || opt.start_pos >= 0) { fprintf (stderr, - _("WARC output does not work with --continue, " - "--continue will be disabled.\n")); + _("WARC output does not work with --continue or" + " --start-pos, they will be disabled.\n")); opt.always_rest = false; + opt.start_pos = -1; } if (opt.warc_cdx_dedup_filename != 0 && !opt.warc_digests_enabled) { @@ -1350,6 +1360,14 @@ for details.\n\n")); exit (1); } + if (opt.start_pos >= 0 && opt.always_rest) + { + fprintf (stderr, + _("Specifying both --start-pos and --continue is not " + "recommended; --continue will be disabled.\n")); + opt.always_rest = false; + } + if (!nurl && !opt.input_filename) { /* No URL specified. */ @@ -1490,7 +1508,7 @@ for details.\n\n")); /* Initialize progress. Have to do this after the options are processed so we know where the log file is. */ - if (opt.verbose) + if (opt.show_progress) set_progress_implementation (opt.progress_type); /* Fill in the arguments. */