top: for symmetry with 'E' add 'e' command line switch

Several years after the 'e' & 'E' interactive commands
were introduce to affect memory scaling, an 'E' switch
was added. This was after discovering a dropped Redhat
patch which provided a unique 'M' command line switch.

If only for symmetry it makes sense to offer a similar
command switch ('e') for the Task Area memory scaling.

As was true with 'E', top's help text will show 'e' as
if it were a switch without arguments in order to keep
help text displayed without wrap in an 80x24 terminal.
The man page, however, will show all of the arguments.

Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/165
. 03/2017, added 'E' command line switch
commit b2bd65407a
. 12/2012, added 'e' interactive command
commit 21e550bc08
. 12/2012, added 'E' interactive command
commit bc46f67f9a

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner
2020-03-29 00:00:00 -05:00
committed by Craig Small
parent b8f757080a
commit 3a3c1604ff
3 changed files with 29 additions and 7 deletions

View File

@@ -3767,6 +3767,15 @@ static void parse_args (char **args) {
if (0 > tmp_delay)
error_exit(N_txt(DELAY_badarg_txt));
break;
case 'e':
{ const char *get = "kmgtp", *got;
if (cp[1]) cp++;
else if (*args) cp = *args++;
else error_exit(fmtmk(N_fmt(MISSING_args_fmt), ch));
if (!(got = strchr(get, tolower(*cp))))
error_exit(fmtmk(N_fmt(BAD_memscale_fmt), *cp));
Rc.task_mscale = (int)(got - get);
} goto bump_cp;
case 'E':
{ const char *get = "kmgtpe", *got;
if (cp[1]) cp++;