~ubuntu-branches/ubuntu/precise/wget/precise-proposed

« back to all changes in this revision

Viewing changes to src/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-10-19 00:00:09 UTC
  • mfrom: (2.1.13 sid)
  • Revision ID: james.westby@ubuntu.com-20111019000009-8p33w3wz4b1rdri0
Tags: 1.13-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add wget-udeb to ship wget.gnu as alternative to busybox wget
    implementation.
  - Depend on libssl-dev 0.9.8k-7ubuntu4 (LP: #503339)
* Dropped changes, superseded in Debian:
  - Keep build dependencies in main:
    + debian/control: remove info2man build-dep
    + debian/patches/series: disable wget-infopod_generated_manpage
  - Mark wget Multi-Arch: foreign, so packages that aren't of the same arch
    can depend on it.
* Pass --with-ssl=openssl; we don't want to use gnutls, there's no udeb for
  it.
* Add a second build pass for the udeb, so we can build without libidn.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Command line parsing.
2
 
   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
3
 
   2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
2
   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 
3
   2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
 
4
   Inc.
4
5
 
5
6
This file is part of GNU Wget.
6
7
 
32
33
 
33
34
#include <stdio.h>
34
35
#include <stdlib.h>
35
 
#ifdef HAVE_UNISTD_H
36
 
# include <unistd.h>
37
 
#endif /* HAVE_UNISTD_H */
 
36
#include <unistd.h>
38
37
#include <string.h>
39
38
#include <signal.h>
40
39
#ifdef ENABLE_NLS
55
54
#include "convert.h"
56
55
#include "spider.h"
57
56
#include "http.h"               /* for save_cookies */
 
57
#include "ptimer.h"
58
58
 
59
59
#include <getopt.h>
60
60
#include <getpass.h>
61
61
#include <quote.h>
62
62
 
 
63
#ifdef WINDOWS
 
64
# include <io.h>
 
65
# include <fcntl.h>
 
66
#endif
 
67
 
63
68
#ifdef __VMS
64
 
#include "vms.h"
 
69
# include "vms.h"
65
70
#endif /* __VMS */
66
71
 
67
72
#ifndef PATH_SEPARATOR
68
73
# define PATH_SEPARATOR '/'
69
74
#endif
70
75
 
 
76
#ifndef ENABLE_IRI
 
77
struct iri dummy_iri;
 
78
#endif
 
79
 
71
80
struct options opt;
72
81
 
73
82
/* defined in version.c */
76
85
extern char *system_getrc;
77
86
extern char *link_string;
78
87
/* defined in build_info.c */
79
 
extern char *compiled_features[];
 
88
extern const char *compiled_features[];
80
89
/* Used for --version output in print_version */
81
90
#define MAX_CHARS_PER_LINE      72
82
91
#define TABULATION              4
164
173
    { IF_SSL ("certificate-type"), 0, OPT_VALUE, "certificatetype", -1 },
165
174
    { IF_SSL ("check-certificate"), 0, OPT_BOOLEAN, "checkcertificate", -1 },
166
175
    { "clobber", 0, OPT__CLOBBER, NULL, optional_argument },
 
176
    { "config", 0, OPT_VALUE, "chooseconfig", -1 },
167
177
    { "connect-timeout", 0, OPT_VALUE, "connecttimeout", -1 },
168
178
    { "continue", 'c', OPT_BOOLEAN, "continue", -1 },
169
179
    { "convert-links", 'k', OPT_BOOLEAN, "convertlinks", -1 },
266
276
    { "timeout", 'T', OPT_VALUE, "timeout", -1 },
267
277
    { "timestamping", 'N', OPT_BOOLEAN, "timestamping", -1 },
268
278
    { "tries", 't', OPT_VALUE, "tries", -1 },
 
279
    { "unlink", 0, OPT_BOOLEAN, "unlink", -1 },
269
280
    { "trust-server-names", 0, OPT_BOOLEAN, "trustservernames", -1 },
 
281
    { "use-server-timestamps", 0, OPT_BOOLEAN, "useservertimestamps", -1 },
270
282
    { "user", 0, OPT_VALUE, "user", -1 },
271
283
    { "user-agent", 'U', OPT_VALUE, "useragent", -1 },
272
284
    { "verbose", 'v', OPT_BOOLEAN, "verbose", -1 },
382
394
 
383
395
/* Print the usage message.  */
384
396
static void
385
 
print_usage (void)
 
397
print_usage (int error)
386
398
{
387
 
  printf (_("Usage: %s [OPTION]... [URL]...\n"), exec_name);
 
399
  fprintf (error ? stderr : stdout, _("Usage: %s [OPTION]... [URL]...\n"),
 
400
           exec_name);
388
401
}
389
402
 
390
403
/* Print the help message, describing all the available options.  If
437
450
    N_("\
438
451
  -B,  --base=URL            resolves HTML input-file links (-i -F)\n\
439
452
                             relative to URL.\n"),
 
453
    N_("\
 
454
       --config=FILE         Specify config file to use.\n"), 
440
455
    "\n",
441
456
 
442
457
    N_("\
449
464
  -O,  --output-document=FILE    write documents to FILE.\n"),
450
465
    N_("\
451
466
  -nc, --no-clobber              skip downloads that would download to\n\
452
 
                                 existing files.\n"),
 
467
                                 existing files (overwriting them).\n"),
453
468
    N_("\
454
469
  -c,  --continue                resume getting a partially-downloaded file.\n"),
455
470
    N_("\
458
473
  -N,  --timestamping            don't re-retrieve files unless newer than\n\
459
474
                                 local.\n"),
460
475
    N_("\
 
476
  --no-use-server-timestamps     don't set the local file's timestamp by\n\
 
477
                                 the one on the server.\n"),
 
478
    N_("\
461
479
  -S,  --server-response         print server response.\n"),
462
480
    N_("\
463
481
       --spider                  don't download anything.\n"),
474
492
    N_("\
475
493
       --waitretry=SECONDS       wait 1..SECONDS between retries of a retrieval.\n"),
476
494
    N_("\
477
 
       --random-wait             wait from 0...2*WAIT secs between retrievals.\n"),
 
495
       --random-wait             wait from 0.5*WAIT...1.5*WAIT secs between retrievals.\n"),
478
496
    N_("\
479
497
       --no-proxy                explicitly turn off proxy.\n"),
480
498
    N_("\
510
528
       --local-encoding=ENC      use ENC as the local encoding for IRIs.\n"),
511
529
    N_("\
512
530
       --remote-encoding=ENC     use ENC as the default remote encoding.\n"),
 
531
    N_("\
 
532
       --unlink                  remove file before clobber.\n"),
513
533
    "\n",
514
534
 
515
535
    N_("\
583
603
#ifdef HAVE_SSL
584
604
    N_("\
585
605
HTTPS (SSL/TLS) options:\n"),
586
 
#ifndef NO_SSLv2
587
606
    N_("\
588
607
       --secure-protocol=PR     choose secure protocol, one of auto, SSLv2,\n\
589
608
                                SSLv3, and TLSv1.\n"),
590
 
#else
591
 
    N_("\
592
 
       --secure-protocol=PR     choose secure protocol, one of auto,\n\
593
 
                                SSLv3, and TLSv1.\n"),
594
 
#endif
595
609
    N_("\
596
610
       --no-check-certificate   don't validate the server's certificate.\n"),
597
611
    N_("\
682
696
    N_("\
683
697
  -I,  --include-directories=LIST  list of allowed directories.\n"),
684
698
    N_("\
685
 
  --trust-server-names  use the name specified by the redirection url last component.\n"),
 
699
  --trust-server-names             use the name specified by the redirection\n\
 
700
                                   url last component.\n"),
686
701
    N_("\
687
702
  -X,  --exclude-directories=LIST  list of excluded directories.\n"),
688
703
    N_("\
696
711
 
697
712
  printf (_("GNU Wget %s, a non-interactive network retriever.\n"),
698
713
          version_string);
699
 
  print_usage ();
 
714
  print_usage (0);
700
715
 
701
716
  for (i = 0; i < countof (help); i++)
702
717
    fputs (_(help[i]), stdout);
734
749
prompt_for_password (void)
735
750
{
736
751
  if (opt.user)
737
 
    printf (_("Password for user %s: "), quote (opt.user));
 
752
    fprintf (stderr, _("Password for user %s: "), quote (opt.user));
738
753
  else
739
 
    printf (_("Password: "));
 
754
    fprintf (stderr, _("Password: "));
740
755
  return getpass("");
741
756
}
742
757
 
790
805
  const char *locale_title  = _("Locale: ");
791
806
  const char *compile_title = _("Compile: ");
792
807
  const char *link_title    = _("Link: ");
793
 
  char *line;
794
808
  char *env_wgetrc, *user_wgetrc;
795
809
  int i;
796
810
 
797
 
#ifdef __VMS
798
 
  printf (_("GNU Wget %s built on VMS %s %s.\n\n"),
799
 
   version_string, vms_arch(), vms_vers());
800
 
#else /* def __VMS */
801
811
  printf (_("GNU Wget %s built on %s.\n\n"), version_string, OS_TYPE);
802
 
#endif /* def __VMS */
803
 
  /* compiled_features is a char*[]. We limit the characters per
804
 
     line to MAX_CHARS_PER_LINE and prefix each line with a constant
805
 
     number of spaces for proper alignment. */
 
812
 
806
813
  for (i = 0; compiled_features[i] != NULL; )
807
814
    {
808
815
      int line_length = MAX_CHARS_PER_LINE;
815
822
      printf ("\n");
816
823
    }
817
824
  printf ("\n");
 
825
 
818
826
  /* Handle the case when $WGETRC is unset and $HOME/.wgetrc is
819
827
     absent. */
820
828
  printf ("%s\n", wgetrc_title);
840
848
                        MAX_CHARS_PER_LINE);
841
849
#endif /* def ENABLE_NLS */
842
850
 
843
 
  format_and_print_line (compile_title,
844
 
                         compilation_string,
845
 
                         MAX_CHARS_PER_LINE);
 
851
  if (compilation_string != NULL)
 
852
    format_and_print_line (compile_title,
 
853
                           compilation_string,
 
854
                           MAX_CHARS_PER_LINE);
846
855
 
847
 
  format_and_print_line (link_title,
848
 
                         link_string,
849
 
                         MAX_CHARS_PER_LINE);
 
856
  if (link_string != NULL)
 
857
    format_and_print_line (link_title,
 
858
                           link_string,
 
859
                           MAX_CHARS_PER_LINE);
850
860
 
851
861
  printf ("\n");
852
862
  /* TRANSLATORS: When available, an actual copyright character
862
872
     names such as this one. See en_US.po for reference. */
863
873
  fputs (_("\nOriginally written by Hrvoje Niksic <hniksic@xemacs.org>.\n"),
864
874
         stdout);
865
 
  fputs (_("Currently maintained by Micah Cowan <micah@cowan.name>.\n"),
866
 
         stdout);
867
875
  fputs (_("Please send bug reports and questions to <bug-wget@gnu.org>.\n"),
868
876
         stdout);
869
877
  exit (0);
876
884
{
877
885
  char **url, **t;
878
886
  int i, ret, longindex;
879
 
  int nurl, status;
 
887
  int nurl;
880
888
  bool append_to_log = false;
881
889
 
 
890
  total_downloaded_bytes = 0;
 
891
 
882
892
  program_name = argv[0];
883
893
 
 
894
  struct ptimer *timer = ptimer_new ();
 
895
  double start_time = ptimer_measure (timer);
 
896
 
884
897
  i18n_initialize ();
885
898
 
886
899
  /* Construct the name of the executable, without the directory part.  */
 
900
#ifdef __VMS
 
901
  /* On VMS, lose the "dev:[dir]" prefix and the ".EXE;nnn" suffix. */
 
902
  exec_name = vms_basename (argv[0]);
 
903
#else /* def __VMS */
887
904
  exec_name = strrchr (argv[0], PATH_SEPARATOR);
888
905
  if (!exec_name)
889
906
    exec_name = argv[0];
890
907
  else
891
908
    ++exec_name;
 
909
#endif /* def __VMS [else] */
892
910
 
893
911
#ifdef WINDOWS
894
912
  /* Drop extension (typically .EXE) from executable filename. */
895
913
  windows_main ((char **) &exec_name);
896
914
#endif
897
915
 
898
 
  /* Set option defaults; read the system wgetrc and ~/.wgetrc.  */
899
 
  initialize ();
 
916
  /* Load the hard-coded defaults.  */
 
917
  defaults ();
900
918
 
901
919
  init_switches ();
 
920
 
 
921
  /* This seperate getopt_long is needed to find the user config
 
922
     and parse it before the other user options. */
 
923
  longindex = -1;
 
924
  int retconf;
 
925
  bool use_userconfig = false;
 
926
 
 
927
  while ((retconf = getopt_long (argc, argv,
 
928
                                short_options, long_options, &longindex)) != -1)
 
929
    {
 
930
      int confval;
 
931
      bool userrc_ret = true;
 
932
      struct cmdline_option *config_opt;
 
933
      confval = long_options[longindex].val;
 
934
      config_opt = &option_data[confval & ~BOOLEAN_NEG_MARKER];
 
935
      if (strcmp (config_opt->long_name, "config") == 0)
 
936
        {
 
937
          userrc_ret &= run_wgetrc (optarg);
 
938
          use_userconfig = true;
 
939
        }
 
940
      if (!userrc_ret)
 
941
        {
 
942
          printf ("Exiting due to error in %s\n", optarg);
 
943
          exit (2);
 
944
        }
 
945
      else
 
946
        break;
 
947
    }
 
948
 
 
949
  /* If the user did not specify a config, read the system wgetrc and ~/.wgetrc. */
 
950
  if (use_userconfig == false)
 
951
    initialize ();
 
952
 
 
953
  opterr = 0;
 
954
  optind = 0;
 
955
 
902
956
  longindex = -1;
903
957
  while ((ret = getopt_long (argc, argv,
904
958
                             short_options, long_options, &longindex)) != -1)
912
966
        {
913
967
          if (ret == '?')
914
968
            {
915
 
              print_usage ();
 
969
              print_usage (0);
916
970
              printf ("\n");
917
971
              printf (_("Try `%s --help' for more options.\n"), exec_name);
918
972
              exit (2);
961
1015
               short options for convenience and backward
962
1016
               compatibility.  */
963
1017
            char *p;
964
 
            for (p = optarg; *p; p++)
 
1018
            for (p = optarg; p && *p; p++)
965
1019
              switch (*p)
966
1020
                {
967
1021
                case 'v':
980
1034
                  setoptval ("noparent", "1", opt->long_name);
981
1035
                  break;
982
1036
                default:
983
 
                  printf (_("%s: illegal option -- `-n%c'\n"), exec_name, *p);
984
 
                  print_usage ();
985
 
                  printf ("\n");
986
 
                  printf (_("Try `%s --help' for more options.\n"), exec_name);
 
1037
                  fprintf (stderr, _("%s: illegal option -- `-n%c'\n"),
 
1038
                           exec_name, *p);
 
1039
                  print_usage (1);
 
1040
                  fprintf (stderr, "\n");
 
1041
                  fprintf (stderr, _("Try `%s --help' for more options.\n"),
 
1042
                           exec_name);
987
1043
                  exit (1);
988
1044
                }
989
1045
            break;
1016
1072
  /* All user options have now been processed, so it's now safe to do
1017
1073
     interoption dependency checks. */
1018
1074
 
 
1075
  if (opt.noclobber && opt.convert_links)
 
1076
    {
 
1077
      fprintf (stderr,
 
1078
               _("Both --no-clobber and --convert-links were specified,"
 
1079
                 "only --convert-links will be used.\n"));
 
1080
      opt.noclobber = false;
 
1081
    }
 
1082
 
1019
1083
  if (opt.reclevel == 0)
1020
1084
      opt.reclevel = INFINITE_RECURSION; /* see recur.h for commentary */
1021
1085
 
1038
1102
  /* Sanity checks.  */
1039
1103
  if (opt.verbose && opt.quiet)
1040
1104
    {
1041
 
      printf (_("Can't be verbose and quiet at the same time.\n"));
1042
 
      print_usage ();
 
1105
      fprintf (stderr, _("Can't be verbose and quiet at the same time.\n"));
 
1106
      print_usage (1);
1043
1107
      exit (1);
1044
1108
    }
1045
1109
  if (opt.timestamping && opt.noclobber)
1046
1110
    {
1047
 
      printf (_("\
 
1111
      fprintf (stderr, _("\
1048
1112
Can't timestamp and not clobber old files at the same time.\n"));
1049
 
      print_usage ();
 
1113
      print_usage (1);
1050
1114
      exit (1);
1051
1115
    }
1052
1116
#ifdef ENABLE_IPV6
1053
1117
  if (opt.ipv4_only && opt.ipv6_only)
1054
1118
    {
1055
 
      printf (_("Cannot specify both --inet4-only and --inet6-only.\n"));
1056
 
      print_usage ();
 
1119
      fprintf (stderr,
 
1120
               _("Cannot specify both --inet4-only and --inet6-only.\n"));
 
1121
      print_usage (1);
1057
1122
      exit (1);
1058
1123
    }
1059
1124
#endif
1064
1129
        {
1065
1130
          fputs (_("\
1066
1131
Cannot specify both -k and -O if multiple URLs are given, or in combination\n\
1067
 
with -p or -r. See the manual for details.\n\n"), stdout);
1068
 
          print_usage ();
 
1132
with -p or -r. See the manual for details.\n\n"), stderr);
 
1133
          print_usage (1);
1069
1134
          exit (1);
1070
1135
        }
1071
1136
      if (opt.page_requisites
1085
1150
      if (opt.noclobber && file_exists_p(opt.output_document))
1086
1151
           {
1087
1152
              /* Check if output file exists; if it does, exit. */
1088
 
              logprintf (LOG_VERBOSE, _("File `%s' already there; not retrieving.\n"), opt.output_document);
 
1153
              logprintf (LOG_VERBOSE,
 
1154
                         _("File `%s' already there; not retrieving.\n"),
 
1155
                         opt.output_document);
1089
1156
              exit(1);
1090
1157
           }
1091
1158
    }
1092
1159
 
1093
1160
  if (opt.ask_passwd && opt.passwd)
1094
1161
    {
1095
 
      printf (_("Cannot specify both --ask-password and --password.\n"));
1096
 
      print_usage ();
 
1162
      fprintf (stderr,
 
1163
               _("Cannot specify both --ask-password and --password.\n"));
 
1164
      print_usage (1);
1097
1165
      exit (1);
1098
1166
    }
1099
1167
 
1100
1168
  if (!nurl && !opt.input_filename)
1101
1169
    {
1102
1170
      /* No URL specified.  */
1103
 
      printf (_("%s: missing URL\n"), exec_name);
1104
 
      print_usage ();
 
1171
      fprintf (stderr, _("%s: missing URL\n"), exec_name);
 
1172
      print_usage (1);
1105
1173
      printf ("\n");
1106
1174
      /* #### Something nicer should be printed here -- similar to the
1107
1175
         pre-1.5 `--help' page.  */
1108
 
      printf (_("Try `%s --help' for more options.\n"), exec_name);
 
1176
      fprintf (stderr, _("Try `%s --help' for more options.\n"), exec_name);
1109
1177
      exit (1);
1110
1178
    }
1111
1179
 
1122
1190
        opt.encoding_remote = NULL;
1123
1191
    }
1124
1192
#else
 
1193
  memset (&dummy_iri, 0, sizeof (dummy_iri));
1125
1194
  if (opt.enable_iri || opt.locale || opt.encoding_remote)
1126
1195
    {
1127
1196
      /* sXXXav : be more specific... */
1128
 
      printf(_("This version does not have support for IRIs\n"));
 
1197
      fprintf (stderr, _("This version does not have support for IRIs\n"));
1129
1198
      exit(1);
1130
1199
    }
1131
1200
#endif
1185
1254
      if (HYPHENP (opt.output_document))
1186
1255
        {
1187
1256
#ifdef WINDOWS
1188
 
          FILE *result;
1189
 
          result = freopen ("CONOUT$", "wb", stdout);
1190
 
          if (result == NULL)
1191
 
            {
1192
 
              logputs (LOG_NOTQUIET, _("\
1193
 
WARNING: Can't reopen standard output in binary mode;\n\
1194
 
         downloaded file may contain inappropriate line endings.\n"));
1195
 
            }
 
1257
          _setmode (_fileno (stdout), _O_BINARY);
1196
1258
#endif
1197
1259
          output_stream = stdout;
1198
1260
        }
1221
1283
          if (fstat (fileno (output_stream), &st) == 0 && S_ISREG (st.st_mode))
1222
1284
            output_stream_regular = true;
1223
1285
        }
 
1286
      if (!output_stream_regular && opt.convert_links)
 
1287
        {
 
1288
          fprintf (stderr, _("-k can be used together with -O only if \
 
1289
outputting to a regular file.\n"));
 
1290
          print_usage (1);
 
1291
          exit(1);
 
1292
        }
1224
1293
    }
1225
1294
 
1226
1295
#ifdef __VMS
1228
1297
     any), otherwise according to the current default device.
1229
1298
  */
1230
1299
  if (output_stream == NULL)
1231
 
    {
1232
 
      set_ods5_dest( "SYS$DISK");
1233
 
    }
 
1300
    set_ods5_dest( "SYS$DISK");
1234
1301
  else if (output_stream != stdout)
1235
 
    {
1236
 
      set_ods5_dest( opt.output_document);
1237
 
    }
 
1302
    set_ods5_dest( opt.output_document);
1238
1303
#endif /* def __VMS */
1239
1304
 
1240
1305
#ifdef WINDOWS
1261
1326
  signal (SIGWINCH, progress_handle_sigwinch);
1262
1327
#endif
1263
1328
 
1264
 
  status = RETROK;              /* initialize it, just-in-case */
1265
1329
  /* Retrieve the URLs from argument list.  */
1266
1330
  for (t = url; *t; t++)
1267
1331
    {
1281
1345
          char *error = url_error (*t, url_err);
1282
1346
          logprintf (LOG_NOTQUIET, "%s: %s.\n",*t, error);
1283
1347
          xfree (error);
1284
 
          status = URLERROR;
 
1348
          inform_exit_status (URLERROR);
1285
1349
        }
1286
1350
      else
1287
1351
        {
1294
1358
              if (url_scheme (*t) == SCHEME_FTP)
1295
1359
                opt.follow_ftp = 1;
1296
1360
 
1297
 
              status = retrieve_tree (url_parsed, NULL);
 
1361
              retrieve_tree (url_parsed, NULL);
1298
1362
 
1299
1363
              opt.follow_ftp = old_follow_ftp;
1300
1364
            }
1301
1365
          else
1302
1366
          {
1303
 
            status = retrieve_url (url_parsed, *t, &filename, &redirected_URL,
1304
 
                                   NULL, &dt, opt.recursive, iri, true);
 
1367
            retrieve_url (url_parsed, *t, &filename, &redirected_URL, NULL,
 
1368
                          &dt, opt.recursive, iri, true);
1305
1369
          }
1306
1370
 
1307
1371
          if (opt.delete_after && file_exists_p(filename))
1322
1386
  if (opt.input_filename)
1323
1387
    {
1324
1388
      int count;
 
1389
      int status;
1325
1390
      status = retrieve_from_file (opt.input_filename, opt.force_html, &count);
 
1391
      inform_exit_status (status);
1326
1392
      if (!count)
1327
1393
        logprintf (LOG_NOTQUIET, _("No URLs found in %s.\n"),
1328
1394
                   opt.input_filename);
1330
1396
 
1331
1397
  /* Print broken links. */
1332
1398
  if (opt.recursive && opt.spider)
1333
 
    {
1334
 
      print_broken_links();
1335
 
    }
 
1399
    print_broken_links ();
1336
1400
 
1337
1401
  /* Print the downloaded sum.  */
1338
1402
  if ((opt.recursive || opt.page_requisites
1341
1405
      &&
1342
1406
      total_downloaded_bytes != 0)
1343
1407
    {
 
1408
      double end_time = ptimer_measure (timer);
 
1409
      ptimer_destroy (timer);
 
1410
 
 
1411
      char *wall_time = xstrdup (secs_to_human_time (end_time - start_time));
 
1412
      char *download_time = xstrdup (secs_to_human_time (total_download_time));
1344
1413
      logprintf (LOG_NOTQUIET,
1345
 
                 _("FINISHED --%s--\nDownloaded: %d files, %s in %s (%s)\n"),
1346
 
                 datetime_str (time (NULL)),
1347
 
                 numurls,
1348
 
                 human_readable (total_downloaded_bytes),
1349
 
                 secs_to_human_time (total_download_time),
1350
 
                 retr_rate (total_downloaded_bytes, total_download_time));
 
1414
                 _("FINISHED --%s--\nTotal wall clock time: %s\n"
 
1415
                   "Downloaded: %d files, %s in %s (%s)\n"),
 
1416
                 datetime_str (time (NULL)),
 
1417
                 wall_time,
 
1418
                 numurls,
 
1419
                 human_readable (total_downloaded_bytes),
 
1420
                 download_time,
 
1421
                 retr_rate (total_downloaded_bytes, total_download_time));
 
1422
      xfree (wall_time);
 
1423
      xfree (download_time);
 
1424
 
1351
1425
      /* Print quota warning, if exceeded.  */
1352
1426
      if (opt.quota && total_downloaded_bytes > opt.quota)
1353
1427
        logprintf (LOG_NOTQUIET,