aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-02-14 21:23:06 +0000
committerEric Andersen <andersen@codepoet.org>2001-02-14 21:23:06 +0000
commit67991cf824f8df27e74c92d754fb507681c69ce6 (patch)
treea0b652f3dc794d1050c1a8de3afb014a621238fa /coreutils
parent68be2ab914e1e20fe666bbd22a89a18714be2789 (diff)
downloadbusybox-67991cf824f8df27e74c92d754fb507681c69ce6.tar.gz
This patch, put together by Manuel Novoa III, is a merge of work
done by Evin Robertson (bug#1105) and work from Manuel to make usage messages occupy less space and simplify how usage messages are displayed.
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/basename.c2
-rw-r--r--coreutils/chroot.c2
-rw-r--r--coreutils/cmp.c2
-rw-r--r--coreutils/date.c8
-rw-r--r--coreutils/dd.c2
-rw-r--r--coreutils/df.c2
-rw-r--r--coreutils/dirname.c2
-rw-r--r--coreutils/dos2unix.c2
-rw-r--r--coreutils/du.c4
-rw-r--r--coreutils/head.c2
-rw-r--r--coreutils/id.c4
-rw-r--r--coreutils/length.c2
-rw-r--r--coreutils/ln.c2
-rw-r--r--coreutils/logname.c2
-rw-r--r--coreutils/ls.c2
-rw-r--r--coreutils/md5sum.c2
-rw-r--r--coreutils/mkdir.c6
-rw-r--r--coreutils/mkfifo.c6
-rw-r--r--coreutils/mknod.c8
-rw-r--r--coreutils/printf.c2
-rw-r--r--coreutils/rm.c4
-rw-r--r--coreutils/rmdir.c2
-rw-r--r--coreutils/sleep.c2
-rw-r--r--coreutils/sort.c2
-rw-r--r--coreutils/sync.c2
-rw-r--r--coreutils/tail.c2
-rw-r--r--coreutils/tee.c2
-rw-r--r--coreutils/touch.c4
-rw-r--r--coreutils/tr.c2
-rw-r--r--coreutils/tty.c2
-rw-r--r--coreutils/uname.c2
-rw-r--r--coreutils/usleep.c2
-rw-r--r--coreutils/uudecode.c2
-rw-r--r--coreutils/uuencode.c4
-rw-r--r--coreutils/wc.c2
-rw-r--r--coreutils/whoami.c2
-rw-r--r--coreutils/yes.c2
37 files changed, 52 insertions, 52 deletions
diff --git a/coreutils/basename.c b/coreutils/basename.c
index cba003d70..da59a8672 100644
--- a/coreutils/basename.c
+++ b/coreutils/basename.c
@@ -31,7 +31,7 @@ extern int basename_main(int argc, char **argv)
char *s;
if ((argc < 2) || (**(argv + 1) == '-')) {
- usage(basename_usage);
+ show_usage();
}
argv++;
diff --git a/coreutils/chroot.c b/coreutils/chroot.c
index cd8101e47..e721e1ffa 100644
--- a/coreutils/chroot.c
+++ b/coreutils/chroot.c
@@ -33,7 +33,7 @@ int chroot_main(int argc, char **argv)
char *prog;
if ((argc < 2) || (**(argv + 1) == '-')) {
- usage(chroot_usage);
+ show_usage();
}
argc--;
argv++;
diff --git a/coreutils/cmp.c b/coreutils/cmp.c
index dd70261df..c04b6e1c9 100644
--- a/coreutils/cmp.c
+++ b/coreutils/cmp.c
@@ -36,7 +36,7 @@ int cmp_main(int argc, char **argv)
/* parse argv[] */
if (argc < 2 || 3 < argc)
- usage(cmp_usage);
+ show_usage();
fp1 = xfopen(argv[1], "r");
if (argv[2] != NULL) {
diff --git a/coreutils/date.c b/coreutils/date.c
index 8b6a0620d..21d31bb25 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -151,7 +151,7 @@ int date_main(int argc, char **argv)
case 's':
set_time = 1;
if ((date_str != NULL) || ((date_str = optarg) == NULL)) {
- usage(date_usage);
+ show_usage();
}
break;
case 'u':
@@ -162,10 +162,10 @@ int date_main(int argc, char **argv)
case 'd':
use_arg = 1;
if ((date_str != NULL) || ((date_str = optarg) == NULL))
- usage(date_usage);
+ show_usage();
break;
default:
- usage(date_usage);
+ show_usage();
}
}
@@ -178,7 +178,7 @@ int date_main(int argc, char **argv)
#if 0
else {
error_msg("date_str='%s' date_fmt='%s'\n", date_str, date_fmt);
- usage(date_usage);
+ show_usage();
}
#endif
diff --git a/coreutils/dd.c b/coreutils/dd.c
index 75bbfbac2..e445e0435 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -84,7 +84,7 @@ int dd_main(int argc, char **argv)
buf++;
}
} else
- usage(dd_usage);
+ show_usage();
}
buf = xmalloc(bs);
diff --git a/coreutils/df.c b/coreutils/df.c
index 55919793c..8b6726b75 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -143,7 +143,7 @@ extern int df_main(int argc, char **argv)
return status;
print_df_usage:
- usage(df_usage);
+ show_usage();
return(FALSE);
}
diff --git a/coreutils/dirname.c b/coreutils/dirname.c
index 2e11a69dc..e34ecf8a9 100644
--- a/coreutils/dirname.c
+++ b/coreutils/dirname.c
@@ -30,7 +30,7 @@ extern int dirname_main(int argc, char **argv)
char* s;
if ((argc < 2) || (**(argv + 1) == '-'))
- usage(dirname_usage);
+ show_usage();
argv++;
s=*argv+strlen(*argv)-1;
diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c
index 9fd952c31..32423611c 100644
--- a/coreutils/dos2unix.c
+++ b/coreutils/dos2unix.c
@@ -31,7 +31,7 @@ int dos2unix_main( int argc, char **argv ) {
if (argc > 1) {
c = *argv[1];
if (c == '-') {
- usage(dos2unix_usage);
+ show_usage();
}
}
c = getchar();
diff --git a/coreutils/du.c b/coreutils/du.c
index c56afbc4f..516f4c92b 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -163,7 +163,7 @@ int du_main(int argc, char **argv)
case 'k': break;
#endif
default:
- usage(du_usage);
+ show_usage();
}
}
@@ -187,7 +187,7 @@ int du_main(int argc, char **argv)
return status;
}
-/* $Id: du.c,v 1.36 2001/01/27 09:33:38 andersen Exp $ */
+/* $Id: du.c,v 1.37 2001/02/14 21:23:05 andersen Exp $ */
/*
Local Variables:
c-file-style: "linux"
diff --git a/coreutils/head.c b/coreutils/head.c
index 7d87f32cb..a2d774437 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -57,7 +57,7 @@ int head_main(int argc, char **argv)
break;
/* fallthrough */
default:
- usage(head_usage);
+ show_usage();
}
}
diff --git a/coreutils/id.c b/coreutils/id.c
index 650e3db20..3667b32b2 100644
--- a/coreutils/id.c
+++ b/coreutils/id.c
@@ -53,11 +53,11 @@ extern int id_main(int argc, char **argv)
name_not_number++;
break;
default:
- usage(id_usage);
+ show_usage();
}
}
- if (no_user && no_group) usage(id_usage);
+ if (no_user && no_group) show_usage();
if (argv[optind] == NULL) {
if (print_real) {
diff --git a/coreutils/length.c b/coreutils/length.c
index 1ab4e3a58..9119adca8 100644
--- a/coreutils/length.c
+++ b/coreutils/length.c
@@ -7,7 +7,7 @@
extern int length_main(int argc, char **argv)
{
if (argc != 2 || **(argv + 1) == '-')
- usage(length_usage);
+ show_usage();
printf("%lu\n", (long)strlen(argv[1]));
return EXIT_SUCCESS;
}
diff --git a/coreutils/ln.c b/coreutils/ln.c
index 54e81f4c5..9dc7f5d8c 100644
--- a/coreutils/ln.c
+++ b/coreutils/ln.c
@@ -101,7 +101,7 @@ extern int ln_main(int argc, char **argv)
flag |= LN_NODEREFERENCE;
break;
default:
- usage(ln_usage);
+ show_usage();
}
}
while(optind<(argc-1)) {
diff --git a/coreutils/logname.c b/coreutils/logname.c
index d9056c69d..a1887aaf9 100644
--- a/coreutils/logname.c
+++ b/coreutils/logname.c
@@ -30,7 +30,7 @@ extern int logname_main(int argc, char **argv)
char user[9];
if (argc > 1)
- usage(logname_usage);
+ show_usage();
my_getpwuid(user, geteuid());
if (*user) {
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 42b24456a..06e23e612 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -928,5 +928,5 @@ extern int ls_main(int argc, char **argv)
return(status);
print_usage_message:
- usage(ls_usage);
+ show_usage();
}
diff --git a/coreutils/md5sum.c b/coreutils/md5sum.c
index 97a940059..3decafdf4 100644
--- a/coreutils/md5sum.c
+++ b/coreutils/md5sum.c
@@ -850,7 +850,7 @@ int md5sum_main(int argc,
break;
default:
- usage(md5sum_usage);
+ show_usage();
}
}
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c
index 299f29806..285d34f12 100644
--- a/coreutils/mkdir.c
+++ b/coreutils/mkdir.c
@@ -48,7 +48,7 @@ extern int mkdir_main(int argc, char **argv)
switch (**argv) {
case 'm':
if (--argc == 0)
- usage(mkdir_usage);
+ show_usage();
/* Find the specified modes */
mode = 0;
if (parse_mode(*(++argv), &mode) == FALSE) {
@@ -63,7 +63,7 @@ extern int mkdir_main(int argc, char **argv)
parentFlag = TRUE;
break;
default:
- usage(mkdir_usage);
+ show_usage();
}
}
argc--;
@@ -71,7 +71,7 @@ extern int mkdir_main(int argc, char **argv)
}
if (argc < 1) {
- usage(mkdir_usage);
+ show_usage();
}
while (argc > 0) {
diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c
index b31e6f172..56a04f772 100644
--- a/coreutils/mkfifo.c
+++ b/coreutils/mkfifo.c
@@ -37,7 +37,7 @@ extern int mkfifo_main(int argc, char **argv)
/* Parse any options */
while (argc > 1) {
if (**argv != '-')
- usage(mkfifo_usage);
+ show_usage();
thisarg = *argv;
thisarg++;
switch (*thisarg) {
@@ -47,13 +47,13 @@ extern int mkfifo_main(int argc, char **argv)
parse_mode(*argv, &mode);
break;
default:
- usage(mkfifo_usage);
+ show_usage();
}
argc--;
argv++;
}
if (argc < 1 || *argv[0] == '-')
- usage(mkfifo_usage);
+ show_usage();
if (mkfifo(*argv, mode) < 0)
perror_msg_and_die("mkfifo");
return EXIT_SUCCESS;
diff --git a/coreutils/mknod.c b/coreutils/mknod.c
index c761aea6f..73f6e06f1 100644
--- a/coreutils/mknod.c
+++ b/coreutils/mknod.c
@@ -53,13 +53,13 @@ int mknod_main(int argc, char **argv)
umask(0);
break;
default:
- usage(mknod_usage);
+ show_usage();
}
argc--;
argv++;
}
if (argc != 4 && argc != 2) {
- usage(mknod_usage);
+ show_usage();
}
switch (argv[1][0]) {
case 'c':
@@ -72,11 +72,11 @@ int mknod_main(int argc, char **argv)
case 'p':
mode = S_IFIFO;
if (argc!=2) {
- usage(mknod_usage);
+ show_usage();
}
break;
default:
- usage(mknod_usage);
+ show_usage();
}
if (mode == S_IFCHR || mode == S_IFBLK) {
diff --git a/coreutils/printf.c b/coreutils/printf.c
index 72bc7ae89..26a200e85 100644
--- a/coreutils/printf.c
+++ b/coreutils/printf.c
@@ -143,7 +143,7 @@ int printf_main(int argc, char **argv)
exit_status = 0;
if (argc <= 1 || **(argv + 1) == '-') {
- usage(printf_usage);
+ show_usage();
}
format = argv[1];
diff --git a/coreutils/rm.c b/coreutils/rm.c
index ce293a2aa..566076707 100644
--- a/coreutils/rm.c
+++ b/coreutils/rm.c
@@ -84,7 +84,7 @@ extern int rm_main(int argc, char **argv)
stopIt = TRUE;
break;
default:
- usage(rm_usage);
+ show_usage();
}
argc--;
argv++;
@@ -94,7 +94,7 @@ extern int rm_main(int argc, char **argv)
}
if (argc < 1 && forceFlag == FALSE) {
- usage(rm_usage);
+ show_usage();
}
while (argc-- > 0) {
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c
index 86346ddde..6266ce1ef 100644
--- a/coreutils/rmdir.c
+++ b/coreutils/rmdir.c
@@ -33,7 +33,7 @@ extern int rmdir_main(int argc, char **argv)
int status = EXIT_SUCCESS;
if (argc == 1 || **(argv + 1) == '-')
- usage(rmdir_usage);
+ show_usage();
while (--argc > 0) {
if (rmdir(*(++argv)) == -1) {
diff --git a/coreutils/sleep.c b/coreutils/sleep.c
index 61b7ce404..d21af19b3 100644
--- a/coreutils/sleep.c
+++ b/coreutils/sleep.c
@@ -29,7 +29,7 @@
extern int sleep_main(int argc, char **argv)
{
if ((argc < 2) || (**(argv + 1) == '-')) {
- usage(sleep_usage);
+ show_usage();
}
if (sleep(atoi(*(++argv))) != 0)
diff --git a/coreutils/sort.c b/coreutils/sort.c
index 2aef2d955..4984f5dfe 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -56,7 +56,7 @@ int sort_main(int argc, char **argv)
break;
#endif
default:
- usage(sort_usage);
+ show_usage();
}
}
diff --git a/coreutils/sync.c b/coreutils/sync.c
index f95c24c6c..fc5a42b8a 100644
--- a/coreutils/sync.c
+++ b/coreutils/sync.c
@@ -28,6 +28,6 @@
extern int sync_main(int argc, char **argv)
{
if (argc > 1 && **(argv + 1) == '-')
- usage(sync_usage);
+ show_usage();
return(sync());
}
diff --git a/coreutils/tail.c b/coreutils/tail.c
index d45b29c4c..a3b8f6d23 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -103,7 +103,7 @@ int tail_main(int argc, char **argv)
break;
#endif
default:
- usage(tail_usage);
+ show_usage();
}
}
diff --git a/coreutils/tee.c b/coreutils/tee.c
index aa3098c6a..439cf7dc5 100644
--- a/coreutils/tee.c
+++ b/coreutils/tee.c
@@ -38,7 +38,7 @@ tee_main(int argc, char **argv)
mode = "a";
break;
default:
- usage(tee_usage);
+ show_usage();
}
}
diff --git a/coreutils/touch.c b/coreutils/touch.c
index e174baa47..a3256d559 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -44,13 +44,13 @@ extern int touch_main(int argc, char **argv)
create = FALSE;
break;
default:
- usage(touch_usage);
+ show_usage();
}
}
}
if (argc < 1) {
- usage(touch_usage);
+ show_usage();
}
while (argc > 0) {
diff --git a/coreutils/tr.c b/coreutils/tr.c
index 36f29de44..92f399e14 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -170,7 +170,7 @@ extern int tr_main(int argc, char **argv)
sq_fl = TRUE;
break;
default:
- usage(tr_usage);
+ show_usage();
}
}
index++;
diff --git a/coreutils/tty.c b/coreutils/tty.c
index 2a64b149d..d71d8dedb 100644
--- a/coreutils/tty.c
+++ b/coreutils/tty.c
@@ -32,7 +32,7 @@ extern int tty_main(int argc, char **argv)
if (argc > 1) {
if (argv[1][0] != '-' || argv[1][1] != 's')
- usage(tty_usage);
+ show_usage();
} else {
tty = ttyname(0);
if (tty)
diff --git a/coreutils/uname.c b/coreutils/uname.c
index deaffd700..899da7792 100644
--- a/coreutils/uname.c
+++ b/coreutils/uname.c
@@ -106,7 +106,7 @@ int uname_main(int argc, char **argv)
PRINT_MACHINE);
break;
default:
- usage(uname_usage);
+ show_usage();
}
}
}
diff --git a/coreutils/usleep.c b/coreutils/usleep.c
index 86dc0501b..c67c365b8 100644
--- a/coreutils/usleep.c
+++ b/coreutils/usleep.c
@@ -28,7 +28,7 @@
extern int usleep_main(int argc, char **argv)
{
if ((argc < 2) || (**(argv + 1) == '-')) {
- usage(usleep_usage);
+ show_usage();
}
usleep(atoi(*(++argv))); /* return void */
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c
index cccc52872..c0e8cea8c 100644
--- a/coreutils/uudecode.c
+++ b/coreutils/uudecode.c
@@ -292,7 +292,7 @@ int uudecode_main (int argc,
break;
default:
- usage(uudecode_usage);
+ show_usage();
}
}
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c
index 73098ba26..8d5af4a8a 100644
--- a/coreutils/uuencode.c
+++ b/coreutils/uuencode.c
@@ -167,7 +167,7 @@ int uuencode_main (int argc,
break;
default:
- usage(uuencode_usage);
+ show_usage();
}
}
@@ -188,7 +188,7 @@ int uuencode_main (int argc,
case 0:
default:
- usage(uuencode_usage);
+ show_usage();
}
printf("begin%s %o %s\n", trans_ptr == uu_std ? "" : "-base64",
diff --git a/coreutils/wc.c b/coreutils/wc.c
index 619c161a7..f41687422 100644
--- a/coreutils/wc.c
+++ b/coreutils/wc.c
@@ -126,7 +126,7 @@ int wc_main(int argc, char **argv)
print_words = 1;
break;
default:
- usage(wc_usage);
+ show_usage();
}
}
diff --git a/coreutils/whoami.c b/coreutils/whoami.c
index 398e37315..54df0bf12 100644
--- a/coreutils/whoami.c
+++ b/coreutils/whoami.c
@@ -31,7 +31,7 @@ extern int whoami_main(int argc, char **argv)
uid_t uid = geteuid();
if (argc > 1)
- usage(whoami_usage);
+ show_usage();
my_getpwuid(user, uid);
if (*user) {
diff --git a/coreutils/yes.c b/coreutils/yes.c
index 0ce49499f..0a8ad83a7 100644
--- a/coreutils/yes.c
+++ b/coreutils/yes.c
@@ -29,7 +29,7 @@ extern int yes_main(int argc, char **argv)
int i;
if (argc >= 2 && *argv[1] == '-')
- usage(yes_usage);
+ show_usage();
if (argc == 1) {
while (1)