4 * $DragonFly: src/bin/cpdup/misc.c,v 1.10 2008/03/22 18:09:42 dillon Exp $
10 logstd(const char *ctl
, ...)
20 logerr(const char *ctl
, ...)
25 vfprintf(stderr
, ctl
, va
);
30 mprintf(const char *ctl
, ...)
38 if (vasprintf(&ptr
, ctl
, va
) < 0)
39 fatal("malloc failed");
46 fextract(FILE *fi
, int n
, int *pc
, int skip
)
55 imax
= (n
< 0) ? 64 : n
+ 1;
59 fprintf(stderr
, "out of memory\n");
64 if (n
== 0 || (n
< 0 && (c
== ' ' || c
== '\n')))
72 fprintf(stderr
, "out of memory\n");
80 if (c
== skip
&& skip
!= EOF
)
88 fatal(const char *ctl
, ...)
93 puts("cpdup [<options>] src [dest]");
94 puts(" -v[vv] verbose level (-vv is typical)\n"
95 " -u use unbuffered output for -v[vv]\n"
96 " -I display performance summary\n"
97 " -f force update even if files look the same\n"
98 " -i0 do NOT confirm when removing something\n"
99 " -s0 disable safeties - allow files to overwrite directories\n"
100 " -q quiet operation\n"
101 " -o do not remove any files, just overwrite/add\n"
105 " -m maintain/generate MD5 checkfile on source,\n"
106 " and compare with (optional) destination,\n"
107 " copying if the compare fails\n"
108 " -M file -m+specify MD5 checkfile, else .MD5_CHECKSUMS\n"
109 " copy if md5 check fails\n"
110 " -H path hardlink from path to target instead of copying\n"
111 " source to target, if source matches path.\n"
112 " -V verify file contents even if they appear\n"
115 " -x use .cpignore as exclusion file\n"
116 " -X file specify exclusion file\n"
117 " Version 1.08 by Matt Dillon and Dima Ruban\n"