summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkn <kn@cvs.openbsd.org>2020-07-26 21:59:17 +0000
committerkn <kn@cvs.openbsd.org>2020-07-26 21:59:17 +0000
commitb146a3f4ae94f393e8f6e60b013d60575a815496 (patch)
treef7f70a08b35f1ebb1e7b0820496d22b617b9afec
parentb71594f1e7655387f2623b903a6319e1536920b1 (diff)
Add / as alias for g (grep)
Simpliy mdoc(7) markup for "n|# count" while here. Positive manual feedback jmc No objections millert
-rw-r--r--usr.bin/top/display.c4
-rw-r--r--usr.bin/top/top.110
-rw-r--r--usr.bin/top/top.c6
3 files changed, 12 insertions, 8 deletions
diff --git a/usr.bin/top/display.c b/usr.bin/top/display.c
index 225c4dd42da..ecc331fd99a 100644
--- a/usr.bin/top/display.c
+++ b/usr.bin/top/display.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: display.c,v 1.62 2020/06/27 01:09:57 kn Exp $ */
+/* $OpenBSD: display.c,v 1.63 2020/07/26 21:59:16 kn Exp $ */
/*
* Top users/processes display for Unix
@@ -810,7 +810,7 @@ show_help(void)
"C - toggle the display of command line arguments\n"
"d count - show `count' displays, then exit\n"
"e - list errors generated by last \"kill\" or \"renice\" command\n"
- "g string - filter on command name (g+ selects all commands)\n"
+ "g|/ string - filter on command name (g+ or /+ selects all commands)\n"
"h | ? - help; show this text\n"
"H - toggle the display of threads\n"
"I | i - toggle the display of idle processes\n"
diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1
index 2027b47b93e..089a345b5e8 100644
--- a/usr.bin/top/top.1
+++ b/usr.bin/top/top.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: top.1,v 1.74 2020/06/23 21:39:19 kn Exp $
+.\" $OpenBSD: top.1,v 1.75 2020/07/26 21:59:16 kn Exp $
.\"
.\" Copyright (c) 1997, Jason Downs. All rights reserved.
.\"
@@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: June 23 2020 $
+.Dd $Mdocdate: July 26 2020 $
.Dt TOP 1
.Os
.Sh NAME
@@ -308,12 +308,14 @@ Display a list of system errors (if any) generated by the last
or
.Li renice
command.
-.It g Ar string
+.It g|/ Ar string
Display only processes that contain
.Ar string
in their command name.
If displaying of arguments is enabled, the arguments are searched too.
.Sq g+
+or
+.Sq /+
shows all processes.
.It H
Toggle the display of process threads.
@@ -330,7 +332,7 @@ by default) to process
.Ar pid .
This acts similarly to the command
.Xr kill 1 .
-.It n\*(Ba# Ar count
+.It n|# Ar count
Show
.Ar count
processes.
diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c
index 3ee62170e2e..21c409b5e81 100644
--- a/usr.bin/top/top.c
+++ b/usr.bin/top/top.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: top.c,v 1.103 2020/06/25 20:38:41 kn Exp $ */
+/* $OpenBSD: top.c,v 1.104 2020/07/26 21:59:16 kn Exp $ */
/*
* Top users/processes display for Unix
@@ -131,6 +131,7 @@ struct statics statics;
#define CMD_up 25
#define CMD_pagedown 26
#define CMD_pageup 27
+#define CMD_grep2 28
static void
usage(void)
@@ -631,7 +632,7 @@ rundisplay(void)
char ch, *iptr;
int change, i;
struct pollfd pfd[1];
- static char command_chars[] = "\f qh?en#sdkriIuSopCHg+P109)(";
+ static char command_chars[] = "\f qh?en#sdkriIuSopCHg+P109)(/";
/*
* assume valid command unless told
@@ -937,6 +938,7 @@ rundisplay(void)
break;
case CMD_grep:
+ case CMD_grep2:
new_message(MT_standout,
"Grep command name: ");
if (readline(tempbuf, sizeof(tempbuf)) > 0) {