From 8e7ef322e21b2232d2a1ff9482ec8ce2808fc5c3 Mon Sep 17 00:00:00 2001 From: Craig Small Date: Sun, 2 Feb 2014 18:13:01 +1100 Subject: [PATCH] Update help files Benno Schulenberg suggested some changes to the help messages to provide some consistency and clarity for both the users and translators of procps. The test needed to be updated as the pmap output changed too. Signed-off-by: Craig Small --- pgrep.c | 14 +++++++------- pidof.c | 2 +- pmap.c | 2 +- ps/help.c | 22 +++++++++++----------- skill.c | 6 +++--- testsuite/pmap.test/pmap.exp | 2 +- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pgrep.c b/pgrep.c index fda7924c..d8d3dcb4 100644 --- a/pgrep.c +++ b/pgrep.c @@ -115,19 +115,19 @@ static int __attribute__ ((__noreturn__)) usage(int opt) } fputs(_(" -c, --count count of matching processes\n"), fp); fputs(_(" -f, --full use full process name to match\n"), fp); - fputs(_(" -g, --pgroup match listed process group IDs\n"), fp); - fputs(_(" -G, --group match real group IDs\n"), fp); + fputs(_(" -g, --pgroup match listed process group IDs\n"), fp); + fputs(_(" -G, --group match real group IDs\n"), fp); fputs(_(" -n, --newest select most recently started\n"), fp); fputs(_(" -o, --oldest select least recently started\n"), fp); - fputs(_(" -P, --parent match only child processes of the given parent\n"), fp); - fputs(_(" -s, --session match session IDs\n"), fp); + fputs(_(" -P, --parent match only child processes of the given parent\n"), fp); + fputs(_(" -s, --session match session IDs\n"), fp); fputs(_(" -t, --terminal match by controlling terminal\n"), fp); - fputs(_(" -u, --euid match by effective IDs\n"), fp); - fputs(_(" -U, --uid match by real IDs\n"), fp); + fputs(_(" -u, --euid match by effective IDs\n"), fp); + fputs(_(" -U, --uid match by real IDs\n"), fp); fputs(_(" -x, --exact match exactly with the command name\n"), fp); fputs(_(" -F, --pidfile read PIDs from file\n"), fp); fputs(_(" -L, --logpidfile fail if PID file is not locked\n"), fp); - fputs(_(" --ns match the processes that belong to the same\n" + fputs(_(" --ns match the processes that belong to the same\n" " namespace as \n"), fp); fputs(_(" --nslist list which namespaces will be considered for\n" " the --ns option.\n" diff --git a/pidof.c b/pidof.c index 6a38675d..d1a9f315 100644 --- a/pidof.c +++ b/pidof.c @@ -62,7 +62,7 @@ static int __attribute__ ((__noreturn__)) usage(int opt) fputs(USAGE_OPTIONS, fp); fputs(_(" -s, --single-shot return one PID only\n"), fp); fputs(_(" -c, --check-root omit processes with different root\n"), fp); - fputs(_(" -x scripts too\n"), fp); + fputs(_(" -x also find shells running the named scripts\n"), fp); fputs(_(" -o, --omit-pid omit processes with PID\n"), fp); fputs(USAGE_SEPARATOR, fp); fputs(USAGE_HELP, fp); diff --git a/pmap.c b/pmap.c index 4ecabce7..66c1c2df 100644 --- a/pmap.c +++ b/pmap.c @@ -106,7 +106,7 @@ usage(FILE * out) { fputs(USAGE_HEADER, out); fprintf(out, - _(" %s [options] pid [pid ...]\n"), program_invocation_short_name); + _(" %s [options] PID [PID ...]\n"), program_invocation_short_name); fputs(USAGE_OPTIONS, out); fputs(_(" -x, --extended show details\n"), out); fputs(_(" -X show even more details\n"), out); diff --git a/ps/help.c b/ps/help.c index 91339032..1b98b738 100644 --- a/ps/help.c +++ b/ps/help.c @@ -109,18 +109,18 @@ void do_help (const char *opt, int rc) { if (section == HELP_LST || section == HELP_ALL) { fputs(_("\nSelection by list:\n"), out); fputs(_(" -C command name\n"), out); - fputs(_(" -G, --Group real group id or name\n"), out); + fputs(_(" -G, --Group real group id or name\n"), out); fputs(_(" -g, --group session or effective group name\n"), out); - fputs(_(" -p, --pid process id\n"), out); - fputs(_(" --ppid select by parent process id\n"), out); + fputs(_(" -p, --pid process id\n"), out); + fputs(_(" --ppid select by parent process id\n"), out); fputs(_(" -s, --sid session id\n"), out); fputs(_(" -t, t, --tty terminal\n"), out); - fputs(_(" -u, U, --user effective user id or name\n"), out); - fputs(_(" -U, --User real user id or name\n"), out); + fputs(_(" -u, U, --user effective user id or name\n"), out); + fputs(_(" -U, --User real user id or name\n"), out); fputs(_("\n" - " selection take either:\n" - " comma-separated list e.g. '-u root,nobody' or\n" - " blank-separated list e.g. '-p 123 4567'\n"), out); + " The selection options take as their argument either:\n" + " a comma-separated list e.g. '-u root,nobody' or\n" + " or a blank-separated list e.g. '-p 123 4567'\n"), out); } if (section == HELP_OUT || section == HELP_ALL) { fputs(_("\nOutput formats:\n"), out); @@ -136,7 +136,7 @@ void do_help (const char *opt, int rc) { fputs(_(" -O preloaded with default columns\n"), out); fputs(_(" O as -O, with BSD personality\n"), out); fputs(_(" -o, o, --format \n" - " user defined format\n"), out); + " user-defined format\n"), out); fputs(_(" s signal format\n"), out); fputs(_(" u user-oriented format\n"), out); fputs(_(" v virtual memory format\n"), out); @@ -152,7 +152,7 @@ void do_help (const char *opt, int rc) { } if (section == HELP_THD || section == HELP_ALL) { fputs(_("\nShow threads:\n"), out); - fputs(_(" H as if they where processes\n"), out); + fputs(_(" H as if they were processes\n"), out); fputs(_(" -L possibly with LWP and NLWP columns\n"), out); fputs(_(" -m, m after processes\n"), out); fputs(_(" -T possibly with SPID column\n"), out); @@ -163,7 +163,7 @@ void do_help (const char *opt, int rc) { fputs(_(" c show true command name\n"), out); fputs(_(" e show the environment after command\n"), out); fputs(_(" k, --sort specify sort order as: [+|-]key[,[+|-]key[,...]]\n"), out); - fputs(_(" L list format specifiers\n"), out); + fputs(_(" L show format specifiers\n"), out); fputs(_(" n display numeric uid and wchan\n"), out); fputs(_(" S, --cumulative include some dead child process data\n"), out); fputs(_(" -y do not show flags, show rss (only with -l)\n"), out); diff --git a/skill.c b/skill.c index 60ed2746..9f3b4fc9 100644 --- a/skill.c +++ b/skill.c @@ -356,7 +356,7 @@ static void __attribute__ ((__noreturn__)) skillsnice_usage(FILE * out) fputs(_(" -i, --interactive interactive\n"), out); fputs(_(" -l, --list list all signal names\n"), out); fputs(_(" -L, --table list all signal names in a nice table\n"), out); - fputs(_(" -n, --no-action no action\n"), out); + fputs(_(" -n, --no-action do not actually kill processes; just print what would happen\n"), out); fputs(_(" -v, --verbose explain what is being done\n"), out); fputs(_(" -w, --warnings enable warnings (not implemented)\n"), out); fputs(USAGE_SEPARATOR, out); @@ -371,8 +371,8 @@ static void __attribute__ ((__noreturn__)) skillsnice_usage(FILE * out) fputs(_(" --ns match the processes that belong to the same\n" " namespace as \n"), out); fputs(_(" --nslist list which namespaces will be considered for\n" - " the --ns option.\n" - " Available namespaces: ipc, mnt, net, pid, user, uts\n"), out); + " the --ns option; available namespaces are\n:" + " ipc, mnt, net, pid, user, uts\n"), out); fputs(USAGE_SEPARATOR, out); fputs(USAGE_SEPARATOR, out); diff --git a/testsuite/pmap.test/pmap.exp b/testsuite/pmap.test/pmap.exp index bc2550a7..5a9e603c 100644 --- a/testsuite/pmap.test/pmap.exp +++ b/testsuite/pmap.test/pmap.exp @@ -22,7 +22,7 @@ set pmap_ext_footer "\[ -\]+\\s+total kB\\s+\\d+(\\s+\[\\d-\]+){2,3}\\s*\$" set test "pmap with no arguments" spawn $pmap #expect_pass "$test" "^\(lt-\)\?pmap: argument missing" -expect_pass "$test" "Usage:\\s+\(lt-\)?pmap \\\[options\\\] pid \\\[pid \.\.\.\\\]" +expect_pass "$test" "Usage:\\s+\(lt-\)?pmap \\\[options\\\] PID \\\[PID \.\.\.\\\]" set test "pmap standard output" spawn $pmap $mypid