diff options
author | gad <gad@FreeBSD.org> | 2004-03-27 21:56:49 +0000 |
---|---|---|
committer | gad <gad@FreeBSD.org> | 2004-03-27 21:56:49 +0000 |
commit | 153d99ec1c0980bc5f9094a5448deda0da67f277 (patch) | |
tree | c518338a108cf157d72bf0516675ac2518688c52 /bin/ps | |
parent | ad1098e739595e6c0d61a41cd9732f33a1f86001 (diff) | |
download | FreeBSD-src-153d99ec1c0980bc5f9094a5448deda0da67f277.zip FreeBSD-src-153d99ec1c0980bc5f9094a5448deda0da67f277.tar.gz |
Change the #if-ish logic which is used to add the `-f' option when `ps'
is compiled with LAZY_PS, so that there is only one PS_ARGS string to
modify when changing the option-list. Also get `-f' to show up in the
usage() statement when compiled with LAZY_PS.
Diffstat (limited to 'bin/ps')
-rw-r--r-- | bin/ps/ps.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/bin/ps/ps.c b/bin/ps/ps.c index a5c283d..a446a90 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -112,10 +112,13 @@ struct listinfo { }; static int needuser, needcomm, needenv; -#if defined(LAZY_PS) -static int forceuread=0; + +#ifdef LAZY_PS +static int forceuread = 0; +#define OPT_LAZY_f "f" #else -static int forceuread=1; +static int forceuread = 1; +#define OPT_LAZY_f /* Ie, the `-f' option is not added. */ #endif static enum sort { DEFAULT, SORTMEM, SORTCPU } sortby = DEFAULT; @@ -150,11 +153,7 @@ static char Zfmt[] = "label"; static kvm_t *kd; -#if defined(LAZY_PS) -#define PS_ARGS "AaCcefG:gHhjLlM:mN:O:o:p:rSTt:U:uvwXxZ" -#else -#define PS_ARGS "AaCceG:gHhjLlM:mN:O:o:p:rSTt:U:uvwXxZ" -#endif +#define PS_ARGS "AaCc" OPT_LAZY_f "G:gHhjLlM:mN:O:o:p:rSTt:U:uvwXxZ" int main(int argc, char *argv[]) @@ -1100,9 +1099,10 @@ kludge_oldps_options(char *s) static void usage(void) { +#define SINGLE_OPTS "[-aC" OPT_LAZY_f "HhjlmrSTuvwXxZ]" (void)fprintf(stderr, "%s\n%s\n%s\n%s\n", - "usage: ps [-aCHhjlmrSTuvwXxZ] [-G gid[,gid]] [-O|o fmt]", + "usage: ps " SINGLE_OPTS " [-G gid[,gid]] [-O|o fmt]", " [-p pid[,pid]] [-t tty[,tty]] [-U user[,user]]", " [-M core] [-N system]", " ps [-L]"); |