Add mandoc-manpage for ln(1)

and mark it as finished in the README.
This commit is contained in:
FRIGN 2015-01-26 14:54:22 +01:00
parent 7067089798
commit 00e7f4e38a
3 changed files with 65 additions and 39 deletions

2
README
View File

@ -37,7 +37,7 @@ The following tools are implemented ('*' == finished, '#' == UTF-8 support,
= hostname non-posix none = hostname non-posix none
=* kill yes none =* kill yes none
=* link yes none =* link yes none
= ln yes none =* ln yes none
=* logger yes none =* logger yes none
= logname yes none = logname yes none
= ls no -C, -R, -q, -u = ls no -C, -R, -q, -u

98
ln.1
View File

@ -1,36 +1,62 @@
.TH LN 1 sbase\-VERSION .Dd January 26, 2015
.SH NAME .Dt LN 1 sbase\-VERSION
ln \- make links between files .Sh NAME
.SH SYNOPSIS .Nm ln
.B ln .Nd link files
.RB [ \-LPfs ] .Sh SYNOPSIS
.I file .Nm ln
.RI [ name ] .Op Fl f
.P .Op Fl L | Fl P | Fl s
.B ln .Ar target
.RB [ \-LPfs ] .Op Ar name
.RI [ file ...] .Nm ln
.RI [ directory ] .Op Fl f
.SH DESCRIPTION .Op Fl L | Fl P | Fl s
.B ln .Ar target ...
creates a hard link to a given file, with the given name. If no name is given .Ar directory
it is linked into the current directory. If multiple files are listed they will .Sh DESCRIPTION
be linked into the given directory. .Nm
.SH OPTIONS creates a hard link
.TP .Ar name
.B \-L to
create links to the files referenced by symbolic link source files (default .Ar target .
behavior). If no
.TP .Ar name
.B \-P is given, a hard link to
create links to symbolic link source files themselves. .Ar target
.TP is created in the current directory.
.B \-f If more than one
remove existing destinations. .Ar target
.TP is given,
.B \-s .Nm
create a symlink. hardlinks them in the existing
.SH SEE ALSO .Ar directory .
.IR cp (1), .Sh OPTIONS
.IR link (2), .Bl -tag -width Ds
.IR symlink (2) .It Fl f
If
.Ar name
exists, remove it to allow the link.
.It Fl L | Fl P
If
.Ar target
is a symbolic link, create a hard link to the (referenced file) | (symbolic link itself).
The former is the default.
.It Fl s
Create symbolic links instead of hard links.
Disables
.Fl L
and
.Fl P ,
because their purpose does not apply to symbolic links.
.El
.Sh SEE ALSO
.Xr cp 1 ,
.Xr link 2 ,
.Xr symlink 2
.Sh STANDARDS
The
.Nm
utility is compliant with the
.St -p1003.1-2008
specification.

4
ln.c
View File

@ -13,8 +13,8 @@
static void static void
usage(void) usage(void)
{ {
eprintf("usage: %1$s [-LPfs] target [linkname]\n" eprintf("usage: %1$s [-f] [-L | -P | -s] target [name]\n"
" %1$s [-LPfs] target... directory\n", argv0); " %1$s [-f] [-L | -P | -s] target ... directory\n", argv0);
} }
int int