Some manpage nits found by jmc.

Index: engine.c
===================================================================
RCS file: /cvs/src/usr.bin/systat/engine.c,v
retrieving revision 1.21
diff -u -p -r1.21 engine.c
--- engine.c    5 Apr 2017 15:57:11 -0000       1.21
+++ engine.c    7 Feb 2018 19:49:03 -0000
@@ -890,6 +890,21 @@ print_fld_float(field_def *fld, double f
 
 /* ordering */
 
+int
+foreach_order(void (*callback)(order_type *))
+{
+       order_type *o;
+
+       if (curr_view == NULL || curr_view->mgr == NULL ||
+           curr_view->mgr->order_list == NULL)
+               return -1;
+       o = curr_view->mgr->order_list;
+       do {
+               callback(o++);
+       } while (o->name != NULL);
+       return 0;
+}
+
 void
 set_order(const char *opt)
 {
Index: engine.h
===================================================================
RCS file: /cvs/src/usr.bin/systat/engine.h,v
retrieving revision 1.8
diff -u -p -r1.8 engine.h
--- engine.h    7 Sep 2013 11:43:49 -0000       1.8
+++ engine.h    7 Feb 2018 19:49:03 -0000
@@ -130,6 +130,7 @@ int set_view(const char *opt);
 void next_view(void);
 void prev_view(void);
 
+int foreach_order(void (*callback)(order_type *));
 void set_order(const char *opt);
 void next_order(void);
 
Index: main.c
===================================================================
RCS file: /cvs/src/usr.bin/systat/main.c,v
retrieving revision 1.66
diff -u -p -r1.66 main.c
--- main.c      13 Oct 2016 11:22:46 -0000      1.66
+++ main.c      7 Feb 2018 19:49:03 -0000
@@ -251,6 +251,31 @@ show_help(void)
 }
 
 void
+add_order_tb(order_type *o)
+{
+       if (curr_view->mgr->order_curr == o)
+               tbprintf("[%s%s(%c)] ", o->name,
+                   o->func != NULL && sortdir == -1 ? "^" : "",
+                   (char) o->hotkey);
+       else
+               tbprintf("%s(%c) ", o->name, (char) o->hotkey);
+}
+
+void
+show_order(void)
+{
+       if (rawmode)
+               return;
+
+       tb_start();
+       if (foreach_order(add_order_tb) == -1) {
+               tbprintf("No orders available");
+       }
+       tb_end();
+       message_set(tmp_buf);
+}
+
+void
 cmd_compat(const char *buf)
 {
        const char *s;
@@ -273,6 +298,11 @@ cmd_compat(const char *buf)
                paused = 0;
                gotsig_alarm = 1;
                cmd_delay(buf + 5);
+               return;
+       }
+       if (strncasecmp(buf, "order", 5) == 0) {
+               show_order();
+               need_update = 1;
                return;
        }
 
Index: pftop.c
===================================================================
RCS file: /cvs/src/usr.bin/systat/pftop.c,v
retrieving revision 1.40
diff -u -p -r1.40 pftop.c
--- pftop.c     19 Jul 2017 12:58:31 -0000      1.40
+++ pftop.c     7 Feb 2018 19:49:03 -0000
@@ -269,7 +269,7 @@ order_type order_list[] = {
 /* Define view managers */
 struct view_manager state_mgr = {
        "States", select_states, read_states, sort_states, print_header,
-       print_states, keyboard_callback, order_list, NULL
+       print_states, keyboard_callback, order_list, order_list
 };
 
 struct view_manager rule_mgr = {
Index: systat.1
===================================================================
RCS file: /cvs/src/usr.bin/systat/systat.1,v
retrieving revision 1.102
diff -u -p -r1.102 systat.1
--- systat.1    15 Jun 2017 03:47:07 -0000      1.102
+++ systat.1    7 Feb 2018 19:49:03 -0000
@@ -219,6 +219,8 @@ command interpreter.
 .Bl -tag -width Fl
 .It Ic help
 Print the names of the available views on the command line.
+.It Ic order
+Print the names of the available orderings on the command line.
 .It Ic quit
 Quit
 .Nm .
@@ -384,6 +386,11 @@ changes the view to show all of them.
 Display kernel
 .Xr pool 9
 per CPU cache statistics.
+Available orderings are:
+.Ic name ,
+.Ic request ,
+and
+.Ic releases .
 .It Ic queues
 Display statistics about the active queues,
 similar to the output of

Reply via email to