]> sjero.net Git - wget/blobdiff - src/main.c
Add --show-progress to force display progress bar
[wget] / src / main.c
index 6b6f72f3d958482053cc525bf12618acb3fdcd74..3d99a1efe16939828632ae8191897ac6a6496067 100644 (file)
@@ -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"),
@@ -952,8 +958,8 @@ print_version (void)
 
   /* TRANSLATORS: When available, an actual copyright character
      (circle-c) should be used in preference to "(C)". */
-  if (fputs (_("\
-Copyright (C) 2011 Free Software Foundation, Inc.\n"), stdout) < 0)
+  if (printf (_("\
+Copyright (C) %s Free Software Foundation, Inc.\n"), "2014") < 0)
     exit (3);
   if (fputs (_("\
 License GPLv3+: GNU GPL version 3 or later\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.  */