diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-02-04 19:17:15 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-02-04 19:17:15 +0000 |
commit | d86323c9a2ac58f90473bfa7c1143c1bd18df832 (patch) | |
tree | 58727f19280c8d9fc07f63f79324ec991debf26f | |
parent | 3d970d8fa2cd0f98c5981105afbdbfe9e32ec31a (diff) |
Introducing the '+' interactive command to reset all filters.
From Mark Lumsden. ok millert@ deraadt@ simon@
-rw-r--r-- | usr.bin/top/commands.c | 3 | ||||
-rw-r--r-- | usr.bin/top/top.1 | 4 | ||||
-rw-r--r-- | usr.bin/top/top.c | 12 |
3 files changed, 15 insertions, 4 deletions
diff --git a/usr.bin/top/commands.c b/usr.bin/top/commands.c index 18154ed0d83..6ea9ba55f2d 100644 --- a/usr.bin/top/commands.c +++ b/usr.bin/top/commands.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commands.c,v 1.21 2007/01/05 09:46:12 otto Exp $ */ +/* $OpenBSD: commands.c,v 1.22 2007/02/04 19:17:14 otto Exp $ */ /* * Top users/processes display for Unix @@ -84,6 +84,7 @@ show_help(void) "sophisticated enough to handle those commands gracefully.\n"); } else { puts( + "+ - remove process filter(s)\n" "C - toggle the display of the command line arguments\n" "d - change number of displays to show\n" "e - list errors generated by last \"kill\" or \"renice\" command\n" diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1 index 438e639be6d..d3914125f67 100644 --- a/usr.bin/top/top.1 +++ b/usr.bin/top/top.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: top.1,v 1.37 2007/01/10 14:02:20 jmc Exp $ +.\" $OpenBSD: top.1,v 1.38 2007/02/04 19:17:14 otto Exp $ .\" .\" Copyright (c) 1997, Jason Downs. All rights reserved. .\" @@ -263,6 +263,8 @@ Quit .Pp The following commands may not be available with overstrike terminals: .Bl -tag -width XxXXXX +.It + +Remove process filter(s). .It C Toggle the display of process command line arguments. .It d diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index a566cfa7ea6..c079ea772f5 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -1,4 +1,4 @@ -/* $OpenBSD: top.c,v 1.46 2007/02/04 15:01:11 otto Exp $ */ +/* $OpenBSD: top.c,v 1.47 2007/02/04 19:17:14 otto Exp $ */ /* * Top users/processes display for Unix @@ -129,6 +129,7 @@ char topn_specified = No; #define CMD_command 18 #define CMD_threads 19 #define CMD_grep 20 +#define CMD_add 21 static void usage(void) @@ -528,7 +529,7 @@ rundisplay(void) int change, i; struct pollfd pfd[1]; uid_t uid; - static char command_chars[] = "\f qh?en#sdkriIuSopCTg"; + static char command_chars[] = "\f qh?en#sdkriIuSopCTg+"; /* * assume valid command unless told @@ -890,6 +891,13 @@ rundisplay(void) clear_message(); break; + case CMD_add: + ps.uid = (uid_t)-1; /* uid */ + ps.pid = (pid_t)-1; /* pid */ + ps.system = old_system; + ps.command = NULL; /* grep */ + break; + default: new_message(MT_standout, " BAD CASE IN SWITCH!"); if (putchar('\r') == EOF) |