From: Simon Wilkinson Date: Sun, 8 Apr 2012 22:31:31 +0000 (-0400) Subject: kas: Don't require config for help X-Git-Tag: upstream/1.8.0_pre1^2~2580 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=49ddcc3b3e9645255db394af0256ea374d06766e;p=packages%2Fo%2Fopenafs.git kas: Don't require config for help Modify the call to ka_Init in kas, so that a fully configured client isn't required in order to generate help output. In particular, permit kas -help, kas -version and kas apropos to run without initialising the ka library. This fixes a problem with running 'make check' on systems that don't have an AFS client installed (or where the AFS client is installed in a different location) Change-Id: I5edd10a319ed6aee163723f99c4f37183f572b2f Reviewed-on: http://gerrit.openafs.org/7129 Reviewed-by: Jeffrey Altman Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/kauth/kas.c b/src/kauth/kas.c index fa57df58d..027b44883 100644 --- a/src/kauth/kas.c +++ b/src/kauth/kas.c @@ -66,10 +66,18 @@ main(int argc, char *argv[]) } #endif - code = ka_Init(0); - if (code) { - afs_com_err(whoami, code, "Can't get cell info"); - exit(1); + /* Don't ka_Init if we're just returning help output. */ + if (argc== 0 || + ( strcmp(argv[1], "-help") != 0 && + strcmp(argv[1], "help") != 0 && + strcmp(argv[1], "-version") != 0 && + strcmp(argv[1], "version") !=0 && + strcmp(argv[1],"apropos") != 0)) { + code = ka_Init(0); + if (code) { + afs_com_err(whoami, code, "Can't get cell info"); + exit(1); + } } /* if there are no arguments or if the first argument is "-cell" or if the