top: extend command line sort field override provision
In a effort to anticipate a potential future wishlist, the recent '-o' sort override command line switch will now support an override of the sort direction as well. By prepending a '+' or '-' to any valid field name the user will be able to guarantee a specific desired sort direction. The '+' forces a high-to-low (normal) order while a '-' reverses that to yield a low-to-high sort. Without this addition users would be left to the mercy of whatever was last specified for Curwin as reflected in the rcfile or top's default of a high-to-low order. (everything is perfectly justified plus right margins) (are completely filled, but of course it must be luck) Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
@ -3291,6 +3291,8 @@ static void parse_args (char **args) {
|
||||
if (cp[1]) cp++;
|
||||
else if (*args) cp = *args++;
|
||||
else error_exit(fmtmk(N_fmt(MISSING_args_fmt), ch));
|
||||
if (*cp == '+') { SETw(Curwin, Qsrt_NORMAL); ++cp; }
|
||||
else if (*cp == '-') { OFFw(Curwin, Qsrt_NORMAL); ++cp; }
|
||||
for (i = 0; i < P_MAXPFLGS; i++)
|
||||
if (!STRCMP(cp, N_col(i))) break;
|
||||
if (i == P_MAXPFLGS)
|
||||
|
Reference in New Issue
Block a user