From a89237ae953b770c82cf9c1dbf192cc54e1dd5be Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Wed, 9 Feb 2005 17:37:39 +0000 Subject: [PATCH] Sync program's usage() with manpage's SYNOPSIS. --- bin/cp/utils.c | 5 +++-- bin/ed/main.c | 4 ++-- bin/getfacl/getfacl.c | 2 +- bin/ln/ln.c | 6 +++--- bin/ls/util.c | 4 ++-- bin/mkdir/mkdir.c | 3 ++- bin/ps/ps.1 | 5 ++--- bin/ps/ps.c | 6 +++--- bin/pwd/pwd.c | 2 +- bin/rcp/rcp.c | 4 ++-- bin/rm/rm.1 | 3 ++- bin/setfacl/setfacl.1 | 4 ++-- bin/setfacl/setfacl.c | 4 ++-- bin/stty/stty.1 | 6 +++--- bin/stty/stty.c | 3 ++- 15 files changed, 32 insertions(+), 29 deletions(-) diff --git a/bin/cp/utils.c b/bin/cp/utils.c index 7ad8788cae50..350522596e4d 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -331,7 +331,8 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", -"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-pv] src target", -" cp [-R [-H | -L | -P]] [-f | -i | -n] [-pv] src1 ... srcN directory"); +"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-pv] source_file target_file", +" cp [-R [-H | -L | -P]] [-f | -i | -n] [-pv] source_file ... " +"target_directory"); exit(EX_USAGE); } diff --git a/bin/ed/main.c b/bin/ed/main.c index 8e5f2211ed6c..807a3cc96bc3 100644 --- a/bin/ed/main.c +++ b/bin/ed/main.c @@ -99,7 +99,7 @@ int lineno; /* script line number */ const char *prompt; /* command-line prompt */ const char *dps = "*"; /* default command-line prompt */ -const char usage[] = "usage: %s [-] [-sx] [-p string] [name]\n"; +const char usage[] = "usage: %s [-] [-sx] [-p string] [file]\n"; /* ed: line editor */ int @@ -134,7 +134,7 @@ main(int argc, char *argv[]) break; default: - fprintf(stderr, usage, argv[0]); + fprintf(stderr, usage, red ? "red" : "ed"); exit(1); } argv += optind; diff --git a/bin/getfacl/getfacl.c b/bin/getfacl/getfacl.c index 75ad1dad4e43..297b41274c63 100644 --- a/bin/getfacl/getfacl.c +++ b/bin/getfacl/getfacl.c @@ -52,7 +52,7 @@ static void usage(void) { - fprintf(stderr, "getfacl [-dh] [files ...]\n"); + fprintf(stderr, "getfacl [-dh] [file ...]\n"); } /* diff --git a/bin/ln/ln.c b/bin/ln/ln.c index 9ad66576ef6d..5609449a4d69 100644 --- a/bin/ln/ln.c +++ b/bin/ln/ln.c @@ -236,8 +236,8 @@ void usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n", - "usage: ln [-fhinsv] file1 file2", - " ln [-fhinsv] file ... directory", - " link file1 file2"); + "usage: ln [-fhinsv] source_file [target_file]", + " ln [-fhinsv] source_file ... target_dir", + " link source_file target_file"); exit(1); } diff --git a/bin/ls/util.c b/bin/ls/util.c index bf80047494cb..1c955cc41464 100644 --- a/bin/ls/util.c +++ b/bin/ls/util.c @@ -222,9 +222,9 @@ usage(void) { (void)fprintf(stderr, #ifdef COLORLS - "usage: ls [-ABCFGHLPRTWZabcdfghiklmnoqrstuwx1]" + "usage: ls [-ABCFGHLPRTWZabcdfghiklmnopqrstuwx1]" #else - "usage: ls [-ABCFHLPRTWZabcdfghiklmnoqrstuwx1]" + "usage: ls [-ABCFHLPRTWZabcdfghiklmnopqrstuwx1]" #endif " [file ...]\n"); exit(1); diff --git a/bin/mkdir/mkdir.c b/bin/mkdir/mkdir.c index 93a39e62728d..024744c8ccde 100644 --- a/bin/mkdir/mkdir.c +++ b/bin/mkdir/mkdir.c @@ -204,6 +204,7 @@ void usage(void) { - (void)fprintf(stderr, "usage: mkdir [-pv] [-m mode] directory ...\n"); + (void)fprintf(stderr, + "usage: mkdir [-pv] [-m mode] directory_name ...\n"); exit (EX_USAGE); } diff --git a/bin/ps/ps.1 b/bin/ps/ps.1 index bcd85e63881d..0dcb546e522b 100644 --- a/bin/ps/ps.1 +++ b/bin/ps/ps.1 @@ -38,14 +38,13 @@ .Sh SYNOPSIS .Nm .Op Fl aCcefHhjlmrSTuvwXxZ +.Op Fl O Ar fmt | Fl o Ar fmt .Op Fl G Ar gid Ns Op , Ns Ar gid Ns Ar ... .Op Fl M Ar core .Op Fl N Ar system -.Op Fl O Ar fmt -.Op Fl o Ar fmt .Op Fl p Ar pid Ns Op , Ns Ar pid Ns Ar ... .Op Fl t Ar tty Ns Op , Ns Ar tty Ns Ar ... -.Op Fl U Ar username Ns Op , Ns Ar username Ns Ar ... +.Op Fl U Ar user Ns Op , Ns Ar user Ns Ar ... .Nm .Op Fl L .Sh DESCRIPTION diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 2bedc17ffee7..73a61212a29a 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -1191,12 +1191,12 @@ check_procfs(void) static void usage(void) { -#define SINGLE_OPTS "[-aCc" OPT_LAZY_f "HhjlmrSTuvwXxZ]" +#define SINGLE_OPTS "[-aCce" OPT_LAZY_f "HhjlmrSTuvwXxZ]" (void)fprintf(stderr, "%s\n%s\n%s\n%s\n", - "usage: ps " SINGLE_OPTS " [-G gid[,gid]] [-O|o fmt]", - " [-p pid[,pid]] [-t tty[,tty]] [-U user[,user]]", + "usage: ps " SINGLE_OPTS " [-O fmt | -o fmt] [-G gid[,gid...]]", " [-M core] [-N system]", + " [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]", " ps [-L]"); exit(1); } diff --git a/bin/pwd/pwd.c b/bin/pwd/pwd.c index f6393cf60857..4baf3aa9e3be 100644 --- a/bin/pwd/pwd.c +++ b/bin/pwd/pwd.c @@ -97,7 +97,7 @@ void usage(void) { - (void)fprintf(stderr, "usage: pwd [-LP]\n"); + (void)fprintf(stderr, "usage: pwd [-L | -P]\n"); exit(1); } diff --git a/bin/rcp/rcp.c b/bin/rcp/rcp.c index c7191300f369..d36f3bd41811 100644 --- a/bin/rcp/rcp.c +++ b/bin/rcp/rcp.c @@ -759,8 +759,8 @@ void usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: rcp [-46p] f1 f2", - " rcp [-46pr] f1 ... fn directory"); + "usage: rcp [-46p] file1 file2", + " rcp [-46pr] file ... directory"); exit(1); } diff --git a/bin/rm/rm.1 b/bin/rm/rm.1 index 9ba934d7e323..c2d2d1b24026 100644 --- a/bin/rm/rm.1 +++ b/bin/rm/rm.1 @@ -41,7 +41,8 @@ .Nd remove directory entries .Sh SYNOPSIS .Nm -.Op Fl dfiIPRrvW +.Op Fl f | i +.Op Fl dIPRrvW .Ar .Nm unlink .Ar file diff --git a/bin/setfacl/setfacl.1 b/bin/setfacl/setfacl.1 index c77084671f69..166328f72ef1 100644 --- a/bin/setfacl/setfacl.1 +++ b/bin/setfacl/setfacl.1 @@ -35,9 +35,9 @@ .Nm .Op Fl bdhkn .Op Fl m Ar entries -.Op Fl M Ar file1 +.Op Fl M Ar file .Op Fl x Ar entries -.Op Fl X Ar file1 +.Op Fl X Ar file .Op Ar .Sh DESCRIPTION The diff --git a/bin/setfacl/setfacl.c b/bin/setfacl/setfacl.c index 6982d319d188..e04feac2e92b 100644 --- a/bin/setfacl/setfacl.c +++ b/bin/setfacl/setfacl.c @@ -96,8 +96,8 @@ static void usage(void) { - fprintf(stderr, "usage: setfacl [-bdhkn] [-m entries] [-M file1] " - "[-x entries] [-X file2] [file ...]\n"); + fprintf(stderr, "usage: setfacl [-bdhkn] [-m entries] [-M file] " + "[-x entries] [-X file] [file ...]\n"); exit(1); } diff --git a/bin/stty/stty.1 b/bin/stty/stty.1 index c77a005a9855..f1f0107bdae7 100644 --- a/bin/stty/stty.1 +++ b/bin/stty/stty.1 @@ -40,15 +40,15 @@ .Nd set the options for a terminal device interface .Sh SYNOPSIS .Nm -.Op Fl a | Fl e | Fl g +.Op Fl a | e | g .Op Fl f Ar file -.Op operands +.Op Ar arguments .Sh DESCRIPTION The .Nm utility sets or reports on terminal characteristics for the device that is its standard input. -If no options or operands are specified, it reports the settings of a subset +If no options or arguments are specified, it reports the settings of a subset of characteristics as well as additional ones if they differ from their default values. Otherwise it modifies diff --git a/bin/stty/stty.c b/bin/stty/stty.c index 383691a73759..f6daaf076ad8 100644 --- a/bin/stty/stty.c +++ b/bin/stty/stty.c @@ -155,6 +155,7 @@ void usage(void) { - (void)fprintf(stderr, "usage: stty [-a|-e|-g] [-f file] [options]\n"); + (void)fprintf(stderr, + "usage: stty [-a | -e | -g] [-f file] [arguments]\n"); exit (1); }