=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/top/top.c,v retrieving revision 1.67 retrieving revision 1.68 diff -c -r1.67 -r1.68 *** src/usr.bin/top/top.c 2009/07/18 06:12:41 1.67 --- src/usr.bin/top/top.c 2009/12/10 13:16:02 1.68 *************** *** 1,4 **** ! /* $OpenBSD: top.c,v 1.67 2009/07/18 06:12:41 jmc Exp $ */ /* * Top users/processes display for Unix --- 1,4 ---- ! /* $OpenBSD: top.c,v 1.68 2009/12/10 13:16:02 tedu Exp $ */ /* * Top users/processes display for Unix *************** *** 83,88 **** --- 83,89 ---- int old_threads = No; int show_args = No; pid_t hlpid = -1; + int combine_cpus = 0; #if Default_TOPN == Infinity char topn_specified = No; *************** *** 116,121 **** --- 117,123 ---- #define CMD_grep 20 #define CMD_add 21 #define CMD_hl 22 + #define CMD_cpus 23 static void usage(void) *************** *** 123,129 **** extern char *__progname; fprintf(stderr, ! "usage: %s [-bCIinqSTu] [-d count] [-g string] [-o field] " "[-p pid] [-s time]\n\t[-U user] [number]\n", __progname); } --- 125,131 ---- extern char *__progname; fprintf(stderr, ! "usage: %s [-1bCIinqSTu] [-d count] [-g string] [-o field] " "[-p pid] [-s time]\n\t[-U user] [number]\n", __progname); } *************** *** 134,145 **** char *endp; int i; ! while ((i = getopt(ac, av, "STICbinqus:d:p:U:o:g:")) != -1) { switch (i) { case 'C': show_args = Yes; break; - case 'u': /* toggle uid/username display */ do_unames = !do_unames; break; --- 136,149 ---- char *endp; int i; ! while ((i = getopt(ac, av, "1STICbinqus:d:p:U:o:g:")) != -1) { switch (i) { + case '1': + combine_cpus = 1; + break; case 'C': show_args = Yes; break; case 'u': /* toggle uid/username display */ do_unames = !do_unames; break; *************** *** 516,522 **** int change, i; struct pollfd pfd[1]; uid_t uid; ! static char command_chars[] = "\f qh?en#sdkriIuSopCTg+P"; /* * assume valid command unless told --- 520,526 ---- int change, i; struct pollfd pfd[1]; uid_t uid; ! static char command_chars[] = "\f qh?en#sdkriIuSopCTg+P1"; /* * assume valid command unless told *************** *** 899,905 **** ps.command = NULL; /* grep */ hlpid = -1; break; ! default: new_message(MT_standout, " BAD CASE IN SWITCH!"); putr(); --- 903,913 ---- ps.command = NULL; /* grep */ hlpid = -1; break; ! case CMD_cpus: ! combine_cpus = !combine_cpus; ! max_topn = display_resize(); ! reset_display(); ! break; default: new_message(MT_standout, " BAD CASE IN SWITCH!"); putr();