sbase

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

commit 6e7743eb5673683d81e8de3d04a9e0d1f33f979f
parent 00d7bf4ea56dd37fe34d6b6aa5a9a1e1dde2abac
Author: Quentin Rameau <quinq@fifth.space>
Date:   Mon, 21 Dec 2015 18:36:28 +0100

Cleanup usage() across sbase

Some tools didn't use argv0 for tool name, or usage() at all.

Diffstat:
Mchgrp.c | 2+-
Mchown.c | 3++-
Med.c | 5++---
Mfind.c | 2+-
Mgrep.c | 3++-
Mjoin.c | 1-
Mnl.c | 2+-
Mrenice.c | 2+-
Mseq.c | 4++--
Mtar.c | 6++++--
Mtouch.c | 3++-
Mwhich.c | 1-
Mxargs.c | 3++-
13 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/chgrp.c b/chgrp.c @@ -37,7 +37,7 @@ chgrp(const char *path, struct stat *st, void *data, struct recursor *r) static void usage(void) { - eprintf("usage: chgrp [-h] [-R [-H | -L | -P]] group file ...\n"); + eprintf("usage: %s [-h] [-R [-H | -L | -P]] group file ...\n", argv0); } int diff --git a/chown.c b/chown.c @@ -40,7 +40,8 @@ chownpwgr(const char *path, struct stat *st, void *data, struct recursor *r) static void usage(void) { - eprintf("usage: %s [-h] [-R [-H | -L | -P]] [owner][:[group]] file ...\n", argv0); + eprintf("usage: %s [-h] [-R [-H | -L | -P]] [owner][:[group]] " + "file ...\n", argv0); } int diff --git a/ed.c b/ed.c @@ -13,7 +13,7 @@ #include <stdlib.h> #include <string.h> -#include "arg.h" +#include "util.h" #define REGEXSIZE 100 #define LINESIZE 80 @@ -1310,8 +1310,7 @@ doglobal(void) static void usage(void) { - fputs("ed [-s][-p][file]\n", stderr); - exit(1); + eprintf("usage: %s [-s] [-p] [file]\n", argv0); } static void diff --git a/find.c b/find.c @@ -992,7 +992,7 @@ find(char *path, struct findhist *hist) static void usage(void) { - eprintf("usage: %s [-H|-L] path... [expression...]\n", argv0); + eprintf("usage: %s [-H | -L] path ... [expression ...]\n", argv0); } int diff --git a/grep.c b/grep.c @@ -166,7 +166,8 @@ end: static void usage(void) { - enprintf(Error, "usage: %s [-EFHchilnqsvwx] [-e pattern] [-f file] [pattern] [file ...]\n", argv0); + enprintf(Error, "usage: %s [-EFHchilnqsvwx] [-e pattern] [-f file] " + "[pattern] [file ...]\n", argv0); } int diff --git a/join.c b/join.c @@ -5,7 +5,6 @@ #include <stdlib.h> #include <string.h> -#include "arg.h" #include "text.h" #include "utf.h" #include "util.h" diff --git a/nl.c b/nl.c @@ -94,7 +94,7 @@ usage(void) { eprintf("usage: %s [-p] [-b type] [-d delim] [-f type]\n" " [-h type] [-i num] [-l num] [-n format]\n" - " [-s sep] [-v num] [-w num] [file]\n", argv0); + " [-s sep] [-v num] [-w num] [file]\n", argv0); } static char diff --git a/renice.c b/renice.c @@ -37,7 +37,7 @@ renice(int which, int who, long adj) static void usage(void) { - eprintf("renice -n num [-g | -p | -u] id ...\n"); + eprintf("usage: %s -n num [-g | -p | -u] id ...\n", argv0); } int diff --git a/seq.c b/seq.c @@ -72,8 +72,8 @@ format: static void usage(void) { - eprintf("usage: %s [-f fmt] [-s sep] [-w] [startnum" - " [step]] endnum\n", argv0); + eprintf("usage: %s [-f fmt] [-s sep] [-w] " + "[startnum [step]] endnum\n", argv0); } int diff --git a/tar.c b/tar.c @@ -490,8 +490,10 @@ xt(int argc, char *argv[], int mode) static void usage(void) { - eprintf("usage: %s [-C dir] [-J | -Z | -a | -j | -z] -x [-m | -t] [-f file] [file ...]\n" - " %s [-C dir] [-J | -Z | -a | -j | -z] [-h] -c path ... [-f file]\n", argv0, argv0); + eprintf("usage: %s [-C dir] [-J | -Z | -a | -j | -z] -x [-m | -t] " + "[-f file] [file ...]\n" + " %s [-C dir] [-J | -Z | -a | -j | -z] [-h] -c path ... " + "[-f file]\n", argv0, argv0); } int diff --git a/touch.c b/touch.c @@ -111,7 +111,8 @@ parsetime(char *str, time_t current) static void usage(void) { - eprintf("usage: %s [-acm] [-d time | -r ref_file | -t time | -T time] file ...\n", argv0); + eprintf("usage: %s [-acm] [-d time | -r ref_file | -t time | -T time] " + "file ...\n", argv0); } int diff --git a/which.c b/which.c @@ -9,7 +9,6 @@ #include <string.h> #include <unistd.h> -#include "arg.h" #include "util.h" static int aflag; diff --git a/xargs.c b/xargs.c @@ -188,7 +188,8 @@ spawn(void) static void usage(void) { - eprintf("usage: %s [-rtx] [-E eofstr] [-n num] [-s num] [cmd [arg ...]]\n", argv0); + eprintf("usage: %s [-rtx] [-E eofstr] [-n num] [-s num] " + "[cmd [arg ...]]\n", argv0); } int