diff options
author | Jindrich Novy | 2005-11-07 15:07:33 +0100 |
---|---|---|
committer | Ruediger Meier | 2018-06-12 14:23:25 +0200 |
commit | cabf1c1cb7409db30917e1d7e8546ec850e43c1d (patch) | |
tree | c565532d53522d2666b3c85cbf1f840a81172379 /misc-utils/hardlink.c | |
parent | Document hardlink command line options. (Ville Skytta) (#161738) (diff) | |
download | kernel-qcow2-util-linux-cabf1c1cb7409db30917e1d7e8546ec850e43c1d.tar.gz kernel-qcow2-util-linux-cabf1c1cb7409db30917e1d7e8546ec850e43c1d.tar.xz kernel-qcow2-util-linux-cabf1c1cb7409db30917e1d7e8546ec850e43c1d.zip |
add -h option
Diffstat (limited to 'misc-utils/hardlink.c')
-rw-r--r-- | misc-utils/hardlink.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/misc-utils/hardlink.c b/misc-utils/hardlink.c index 1e102101f..fd511c894 100644 --- a/misc-utils/hardlink.c +++ b/misc-utils/hardlink.c @@ -96,10 +96,11 @@ void doexit(int i) void usage(char *prog) { - fprintf (stderr, "Usage: %s [-cnv] directories...\n", prog); + fprintf (stderr, "Usage: %s [-cnvh] directories...\n", prog); fprintf (stderr, " -c When finding candidates for linking, compare only file contents.\n"); fprintf (stderr, " -n Don't actually link anything, just report what would be done.\n"); fprintf (stderr, " -v Operate in verbose mode.\n"); + fprintf (stderr, " -h Show help.\n"); exit(255); } @@ -125,7 +126,7 @@ void rf (char *name) int fd, i; f * fp, * fp2; h * hp; - char *p, *q; + char *p = NULL, *q; char *n1, *n2; int cksumsize = sizeof(buf); unsigned int cksum; @@ -292,7 +293,7 @@ int main(int argc, char **argv) d * dp; DIR *dh; struct dirent *di; - while ((ch = getopt (argc, argv, "cnv")) != -1) { + while ((ch = getopt (argc, argv, "cnvh")) != -1) { switch (ch) { case 'n': no_link++; @@ -303,6 +304,7 @@ int main(int argc, char **argv) case 'c': content_only++; break; + case 'h': default: usage(argv[0]); } |