sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

commit cb610b2c7ba04b8232978ae7cb312c4b8e84bbd1
parent 804b62f7a2810bbfaf9c45616d35b9df7f13cc34
Author: FRIGN <dev@frign.de>
Date:   Sat, 28 Feb 2015 19:42:26 +0100

Audit link(1)

Diffstat:
MREADME | 2+-
Mlink.c | 18++++++++++++++----
2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/README b/README @@ -37,7 +37,7 @@ The following tools are implemented ('*' == finished, '#' == UTF-8 support, =* head yes none =* hostname non-posix none =* kill yes none -=* link yes none +=*| link yes none =* ln yes none =* logger yes none =* logname yes none diff --git a/link.c b/link.c @@ -3,14 +3,24 @@ #include "util.h" +static void +usage(void) +{ + eprintf("usage: %s target name\n", argv0); +} + int main(int argc, char *argv[]) { - argv0 = argv[0]; + ARGBEGIN { + default: + usage(); + } ARGEND; - if (argc != 3) - eprintf("usage: %s target name\n", argv0); - if (link(argv[1], argv[2]) < 0) + if (argc != 2) + usage(); + if (link(argv[0], argv[1]) < 0) eprintf("link:"); + return 0; }