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 <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
}
#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