add --version as a special case

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11226 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2002-08-23 19:29:38 +00:00
parent 96c121c4f4
commit 68823821a9
3 changed files with 13 additions and 0 deletions

View File

@@ -170,6 +170,11 @@ main(int argc, char **argv)
*/
autologin = -1;
if (argc == 2 && strcmp(argv[1], "--version") == 0) {
print_version(NULL);
exit(0);
}
while((ch = getopt(argc, argv,
"78DEKLS:X:abcde:fFk:l:n:rxG")) != -1) {
switch(ch) {

View File

@@ -176,6 +176,11 @@ main(int argc, char **argv)
highpty = getnpty();
#endif /* CRAY */
if (argc == 2 && strcmp(argv[1], "--version") == 0) {
print_version(NULL);
exit(0);
}
while ((ch = getopt(argc, argv, valid_opts)) != -1) {
switch(ch) {

View File

@@ -241,6 +241,9 @@ init_words (int argc, char **argv)
if (appres.file == NULL)
errx (1, "cannot allocate memory for message");
}
} else if(strcmp(argv[i], "--version") == 0) {
print_version(NULL);
exit(0);
} else {
int j;
int len = 1;