top: provide -1 command line switch as 'Cpu(s)' toggle
If built without ./configure --disable-modern-top, the
program displays each cpu individually providing there
is sufficient vertical screen real estate. For massive
SMP environments this will necessitate use of a config
file where the cpu summary toggle ('1') could be saved
via the 'W' command. But, an rcfile may not be viable.
So this commit introduces a '1' command line switch to
emulate exactly the effects of the interactive toggle.
And since it is our first numeric switch some existing
parsing logic had to be changed slightly. Such changes
are, in truth, an improvement. For example, instead of
seeing "inappropriate '2'" with ./top -2 we'll now see
the vastly more appropriate error "unknown option '2'.
References(s):
https://gitlab.com/procps-ng/procps/issues/55
[ this patch has been adapted from the master branch ]
Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
@@ -336,7 +336,7 @@ static void build_norm_nlstab (void) {
|
||||
Norm_nlstab[OFF_one_word_txt] = _("Off");
|
||||
/* Translation Hint: Only the following words should be translated
|
||||
. secs (seconds), max (maximum), user, field, cols (columns)*/
|
||||
Norm_nlstab[USAGE_abbrev_txt] = _(" -hv | -bcEHiOSs -d secs -n max -u|U user -p pid(s) -o field -w [cols]");
|
||||
Norm_nlstab[USAGE_abbrev_txt] = _(" -hv | -bcEHiOSs1 -d secs -n max -u|U user -p pid(s) -o field -w [cols]");
|
||||
Norm_nlstab[FOREST_modes_fmt] = _("Forest mode %s");
|
||||
Norm_nlstab[FAIL_tty_get_txt] = _("failed tty get");
|
||||
Norm_nlstab[FAIL_tty_set_fmt] = _("failed tty set: %s");
|
||||
|
||||
Reference in New Issue
Block a user