Cleanup usage() across sbase

Some tools didn't use argv0 for tool name, or usage() at all.
This commit is contained in:
Quentin Rameau 2015-12-21 18:36:28 +01:00 committed by sin
parent 00d7bf4ea5
commit 6e7743eb56
13 changed files with 20 additions and 17 deletions

View File

@ -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

View File

@ -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

5
ed.c
View File

@ -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

3
grep.c
View File

@ -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

1
join.c
View File

@ -5,7 +5,6 @@
#include <stdlib.h>
#include <string.h>
#include "arg.h"
#include "text.h"
#include "utf.h"
#include "util.h"

View File

@ -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

4
seq.c
View File

@ -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

6
tar.c
View File

@ -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

View File

@ -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

View File

@ -9,7 +9,6 @@
#include <string.h>
#include <unistd.h>
#include "arg.h"
#include "util.h"
static int aflag;

View File

@ -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