.ds CG \'current\' window/field group
.ds CI interactive command
\# - Note: our 'Command Line' used in 2 places
-.ds CL \-\fBhv\fR|\-\fBbcHiSs\fR \-\fBd\fR delay \-\fBn\fR limit \
-\-\fBu\fR|\fBU\fR user \-\fBp\fR pid[,pid] \-\fBw\fR [cols] \fR
+\# ( and managed to fit in an 80x24 terminal )
+.ds CL \-\fBhv\fR|\-\fBbcHiOSs\fR \-\fBd\fR secs \-\fBn\fR max \
+\-\fBu\fR|\fBU\fR user \-\fBp\fR pid \-\fBo\fR fld \-\fBw\fR [cols] \fR
.ds CO command\-line option
.ds CT command toggle
.ds CW \'current\' window
Specifies the maximum number of iterations, or frames, \*(We should
produce before ending.
+.TP 5
+\-\fBo\fR :\fI Override-sort-field\fR as:\fB\ \ \-o fieldname \fR
+Specifies the name of the field on which tasks will be sorted, independent
+of what is reflected in the configuration file.
+
+This option exists primarily to support automated/scripted batch mode
+operation.
+
+.TP 5
+\-\fBO\fR :\fI Output-field-names \fR
+This option acts as a form of help for the above \-o option.
+It will cause \*(We to print each of the available field names on a
+separate line, then quit.
+Such names are subject to nls translation.
+
.TP 5
\-\fBp\fR :\fI Monitor-PIDs\fR mode as:\fB\ \ \-pN1 -pN2 ...\fR\ \ or\fB\ \ \-pN1,N2,N3 ... \fR
Monitor only processes with specified process IDs.
static const char numbs_str[] = "+,-.0123456789";
float tmp_delay = MAXFLOAT;
char *p;
+ int i;
while (*args) {
const char *cp = *(args++);
break;
case 'h':
case 'v':
- fprintf(stdout, N_fmt(HELP_cmdline_fmt)
- , procps_version, Myname, N_txt(USAGE_abbrev_txt));
+ puts(fmtmk(N_fmt(HELP_cmdline_fmt)
+ , procps_version, Myname, N_txt(USAGE_abbrev_txt)));
bye_bye(NULL);
case 'i':
TOGw(Curwin, Show_IDLEPS);
if (1 != sscanf(cp, "%d", &Loops) || 1 > Loops)
error_exit(fmtmk(N_fmt(BAD_niterate_fmt), cp));
break;
+ case 'o':
+ if (cp[1]) cp++;
+ else if (*args) cp = *args++;
+ else error_exit(fmtmk(N_fmt(MISSING_args_fmt), ch));
+ for (i = 0; i < P_MAXPFLGS; i++)
+ if (!STRCMP(cp, N_col(i))) break;
+ if (i == P_MAXPFLGS)
+ error_exit(fmtmk(N_fmt(XTRA_sortopt_fmt), cp));
+ OFFw(Curwin, Show_FOREST);
+ Curwin->rc.sortindx = i;
+ cp += strlen(cp);
+ break;
+ case 'O':
+ for (i = 0; i < P_MAXPFLGS; i++)
+ puts(N_col(i));
+ bye_bye(NULL);
case 'p':
if (Curwin->usrseltyp) error_exit(N_txt(SELECT_clash_txt));
- do { int i, pid;
+ do { int pid;
if (cp[1]) cp++;
else if (*args) cp = *args++;
else error_exit(fmtmk(N_fmt(MISSING_args_fmt), ch));
"\tsee http://www.debian.org/Bugs/Reporting\n");
Norm_nlstab[WRONG_switch_fmt] = _(""
"inappropriate '%s'\n"
- "usage:\t%s%s");
+ "Usage:\n %s%s");
Norm_nlstab[HELP_cmdline_fmt] = _(""
- "\t%s\n"
- "usage:\t%s%s");
+ " %s\n"
+ "Usage:\n %s%s");
Norm_nlstab[FAIL_statopn_fmt] = _("failed /proc/stat open: %s");
Norm_nlstab[FAIL_openlib_fmt] = _("failed openproc: %s");
Norm_nlstab[BAD_delayint_fmt] = _("bad delay interval '%s'");
Norm_nlstab[BAD_widtharg_fmt] = _("bad width arg '%s', must > %d");
Norm_nlstab[UNKNOWN_opts_fmt] = _(""
"unknown option '%c'\n"
- "usage:\t%s%s");
+ "Usage:\n %s%s");
Norm_nlstab[DELAY_secure_txt] = _("-d disallowed in \"secure\" mode");
Norm_nlstab[DELAY_badarg_txt] = _("-d requires positive argument");
Norm_nlstab[ON_word_only_txt] = _("On");
Norm_nlstab[OFF_one_word_txt] = _("Off");
/* Translation Hint: Only the following words should be translated
. delay, limit, user, cols (abbreviation for columns)*/
- Norm_nlstab[USAGE_abbrev_txt] = _(" -hv | -bcHiSs -d delay -n limit -u|U user -p pid[,pid] -w [cols]");
+ Norm_nlstab[USAGE_abbrev_txt] = _(" -hv | -bcHiOSs -d secs -n max -u|U user -p pid(s) -o field -w [cols]");
Norm_nlstab[FAIL_statget_txt] = _("failed /proc/stat read");
Norm_nlstab[FOREST_modes_fmt] = _("Forest mode %s");
Norm_nlstab[FAIL_tty_get_txt] = _("failed tty get");
Norm_nlstab[FIND_no_find_fmt] = _("%s\"%s\" not found");
Norm_nlstab[XTRA_fixwide_fmt] = _("width incr is %d, change to (0 default, -1 auto)");
Norm_nlstab[XTRA_warncfg_txt] = _("Overwrite existing obsolete/corrupted rcfile?");
+ Norm_nlstab[XTRA_sortopt_fmt] = _("unrecognized field name '%s'");
#ifndef INSP_OFFDEMO
Norm_nlstab[YINSP_demo01_txt] = _("Open Files");
Norm_nlstab[YINSP_demo02_txt] = _("NUMA Info");
THREADS_show_fmt, TIME_accumed_fmt, UNKNOWN_cmds_txt, UNKNOWN_opts_fmt,
USAGE_abbrev_txt, WORD_allcpus_txt, WORD_another_txt, WORD_eachcpu_fmt,
WORD_process_txt, WORD_threads_txt, WRITE_rcfile_fmt, WRONG_switch_fmt,
- XTRA_fixwide_fmt,
-#ifndef WARN_CFG_OFF
- XTRA_warncfg_txt,
-#endif
+ XTRA_fixwide_fmt, XTRA_sortopt_fmt, XTRA_warncfg_txt,
#ifndef INSP_OFFDEMO
YINSP_demo01_txt, YINSP_demo02_txt, YINSP_demo03_txt, YINSP_deqfmt_txt,
YINSP_deqtyp_txt, YINSP_dstory_txt,