summaryrefslogtreecommitdiff
path: root/utils/ps.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-12-17 02:01:21 +0000
committerMiles Bader <miles@gnu.org>1996-12-17 02:01:21 +0000
commit61b10d3061f8bb0a2e193a3b65b7c978334966c8 (patch)
treea68facddf185505391b31e75822a727d1feaa095 /utils/ps.c
parent505cf7ea0b583f66d61e7f28ef66793da09fbbb9 (diff)
(main):
Implement --bottom/--tail/-b. (options): Update doc for --top. Add --head and --bottom/--tail/-b options.
Diffstat (limited to 'utils/ps.c')
-rw-r--r--utils/ps.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/utils/ps.c b/utils/ps.c
index 06df9d92..4e479a23 100644
--- a/utils/ps.c
+++ b/utils/ps.c
@@ -80,7 +80,13 @@ static const struct argp_option options[] =
{"sort", 's', "FIELD",0, "Sort the output with respect to FIELD,"
" backwards if FIELD is prefixed by `-'"},
{"threads", 'T', 0, 0, "Show the threads for each process"},
- {"top", 'h', "ENTRIES", OA, "Show the top ENTRIES processes (default 10)"},
+ {"top", 'h', "ENTRIES", OA, "Show the top ENTRIES processes"
+ " (default 10), or if ENTRIES is"
+ " negative, the bottom -ENTRIES"},
+ {"head", 0, 0, OPTION_ALIAS},
+ {"bottom", 'b', "ENTRIES", OA, "Show the bottom ENTRIES processes"
+ " (default 10)"},
+ {"tail", 0, 0, OPTION_ALIAS},
{"tty", 't', "TTY", OA, "Only show processes with controlling"
" terminal TTY"},
{0, 'u', 0, 0, "Use the `user' output-format"},
@@ -491,6 +497,7 @@ main(int argc, char *argv[])
case 's': sort_key_name = arg; break;
case 'r': sort_reverse = TRUE; break;
case 'h': top = arg ? atoi (arg) : 10; break;
+ case 'b': top = -(arg ? atoi (arg) : 10); break;
case 'F': fmt_string = arg; posix_fmt = 0; break;
case 'o': fmt_string = arg; posix_fmt = 1; break;