diff options
author | rwatson <rwatson@FreeBSD.org> | 2006-09-23 15:43:29 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2006-09-23 15:43:29 +0000 |
commit | 2f0a02201d4138870fc8e30f35809b7c9e2c86ea (patch) | |
tree | 2b8cc6ba0aa5fbc99c719252e5630d6ecee5c15e /usr.bin/id/id.c | |
parent | 9af53fcaabbc08489f360aaebe10bb92a9f7d9a6 (diff) | |
download | FreeBSD-src-2f0a02201d4138870fc8e30f35809b7c9e2c86ea.zip FreeBSD-src-2f0a02201d4138870fc8e30f35809b7c9e2c86ea.tar.gz |
Rename "-a" flag to "-A" in order to avoid conflicting with the "-a" flag
as found on Solaris.
Requested by: ceri
MFC after: 3 days
Diffstat (limited to 'usr.bin/id/id.c')
-rw-r--r-- | usr.bin/id/id.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/usr.bin/id/id.c b/usr.bin/id/id.c index 1e43252..b8f1519 100644 --- a/usr.bin/id/id.c +++ b/usr.bin/id/id.c @@ -78,11 +78,11 @@ main(int argc, char *argv[]) struct group *gr; struct passwd *pw; int Gflag, Mflag, Pflag, ch, gflag, id, nflag, pflag, rflag, uflag; - int aflag; + int Aflag; const char *myname; Gflag = Mflag = Pflag = gflag = nflag = pflag = rflag = uflag = 0; - aflag = 0; + Aflag = 0; myname = strrchr(argv[0], '/'); myname = (myname != NULL) ? myname + 1 : argv[0]; @@ -96,8 +96,13 @@ main(int argc, char *argv[]) } while ((ch = getopt(argc, argv, - (isgroups || iswhoami) ? "" : "PGMagnpru")) != -1) + (isgroups || iswhoami) ? "" : "APGMgnpru")) != -1) switch(ch) { +#ifdef USE_BSM_AUDIT + case 'A': + Aflag = 1; + break; +#endif case 'G': Gflag = 1; break; @@ -107,9 +112,6 @@ main(int argc, char *argv[]) case 'P': Pflag = 1; break; - case 'a': - aflag = 1; - break; case 'g': gflag = 1; break; @@ -135,7 +137,7 @@ main(int argc, char *argv[]) if (iswhoami && argc > 0) usage(); - switch(Gflag + Mflag + Pflag + aflag + gflag + pflag + uflag) { + switch(Aflag + Gflag + Mflag + Pflag + gflag + pflag + uflag) { case 1: break; case 0: @@ -152,13 +154,10 @@ main(int argc, char *argv[]) usage(); #ifdef USE_BSM_AUDIT - if (aflag) { + if (Aflag) { auditid(); exit(0); } -#else - if (aflag) - usage(); #endif if (gflag) { @@ -418,16 +417,16 @@ usage(void) else if (iswhoami) (void)fprintf(stderr, "usage: whoami\n"); else - (void)fprintf(stderr, "%s\n%s\n%s\n%s%s\n%s\n%s\n%s\n", + (void)fprintf(stderr, "%s\n%s%s\n%s\n%s\n%s\n%s\n%s\n", "usage: id [user]", - " id -G [-n] [user]", - " id -M", - " id -P [user]", #ifdef USE_BSM_AUDIT - " id -a\n", + " id -A\n", #else "", #endif + " id -G [-n] [user]", + " id -M", + " id -P [user]", " id -g [-nr] [user]", " id -p [user]", " id -u [-nr] [user]"); |