Sun Aug 26 23:01:06 2018 UTC ()
Update usage to include -w
Match sequence as per SYNOPSIS in manual


(sevan)
diff -r1.39 -r1.40 src/bin/ln/ln.c

cvs diff -r1.39 -r1.40 src/bin/ln/ln.c (expand / switch to unified diff)

--- src/bin/ln/ln.c 2017/04/22 12:22:31 1.39
+++ src/bin/ln/ln.c 2018/08/26 23:01:06 1.40
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ln.c,v 1.39 2017/04/22 12:22:31 kre Exp $ */ 1/* $NetBSD: ln.c,v 1.40 2018/08/26 23:01:06 sevan Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1987, 1993, 1994 4 * Copyright (c) 1987, 1993, 1994
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -34,27 +34,27 @@ @@ -34,27 +34,27 @@
34static char const copyright[] = 34static char const copyright[] =
35"@(#) Copyright (c) 1987, 1993, 1994\n\ 35"@(#) Copyright (c) 1987, 1993, 1994\n\
36 The Regents of the University of California. All rights reserved.\n"; 36 The Regents of the University of California. All rights reserved.\n";
37#endif /* not lint */ 37#endif /* not lint */
38 38
39#ifndef lint 39#ifndef lint
40static char sccsid[] = "@(#)ln.c 8.2 (Berkeley) 3/31/94"; 40static char sccsid[] = "@(#)ln.c 8.2 (Berkeley) 3/31/94";
41#endif /* not lint */ 41#endif /* not lint */
42#endif 42#endif
43#include <sys/cdefs.h> 43#include <sys/cdefs.h>
44#ifdef __FBSDID 44#ifdef __FBSDID
45__FBSDID("$FreeBSD: head/bin/ln/ln.c 251261 2013-06-02 17:55:00Z eadler $"); 45__FBSDID("$FreeBSD: head/bin/ln/ln.c 251261 2013-06-02 17:55:00Z eadler $");
46#endif 46#endif
47__RCSID("$NetBSD: ln.c,v 1.39 2017/04/22 12:22:31 kre Exp $"); 47__RCSID("$NetBSD: ln.c,v 1.40 2018/08/26 23:01:06 sevan Exp $");
48 48
49#include <sys/param.h> 49#include <sys/param.h>
50#include <sys/stat.h> 50#include <sys/stat.h>
51 51
52#include <err.h> 52#include <err.h>
53#include <errno.h> 53#include <errno.h>
54#include <fcntl.h> 54#include <fcntl.h>
55#include <libgen.h> 55#include <libgen.h>
56#include <limits.h> 56#include <limits.h>
57#include <stdio.h> 57#include <stdio.h>
58#include <stdlib.h> 58#include <stdlib.h>
59#include <string.h> 59#include <string.h>
60#include <unistd.h> 60#include <unistd.h>
@@ -348,18 +348,18 @@ linkit(const char *source, const char *t @@ -348,18 +348,18 @@ linkit(const char *source, const char *t
348 Pflag ? 0 : AT_SYMLINK_FOLLOW)) { 348 Pflag ? 0 : AT_SYMLINK_FOLLOW)) {
349 warn("%s", target); 349 warn("%s", target);
350 return (1); 350 return (1);
351 } 351 }
352 if (vflag) 352 if (vflag)
353 (void)printf("%s %c> %s\n", target, linkch, source); 353 (void)printf("%s %c> %s\n", target, linkch, source);
354 return (0); 354 return (0);
355} 355}
356 356
357static __dead void 357static __dead void
358usage(void) 358usage(void)
359{ 359{
360 (void)fprintf(stderr,  360 (void)fprintf(stderr,
361 "usage: %s [-s [-F] | -L | -P] [-f | -i] [-hnv] source_file [target_file]\n" 361 "usage: %s [-L | -P | -s [-F]] [-f | -iw] [-hnv] source_file [target_file]\n"
362 " %s [-s [-F] | -L | -P] [-f | -i] [-hnv] source_file ... target_dir\n" 362 " %s [-L | -P | -s [-F]] [-f | -iw] [-hnv] source_file ... target_dir\n"
363 " link source_file target_file\n", getprogname(), getprogname()); 363 " link source_file target_file\n", getprogname(), getprogname());
364 exit(1); 364 exit(1);
365} 365}