1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-13 17:17:37 -05:00

Fixes for more robust handling of command-line parse errors.

[originally from svn r2236]
This commit is contained in:
Simon Tatham
2002-11-20 20:09:02 +00:00
parent 75ebfa28f0
commit 0c110dcd10
5 changed files with 35 additions and 9 deletions

7
scp.c
View File

@ -2166,7 +2166,7 @@ void cmdline_error(char *p, ...)
va_start(ap, p);
vfprintf(stderr, p, ap);
va_end(ap);
fputc('\n', stderr);
fprintf(stderr, "\n try typing just \"pscp\" for help\n");
exit(1);
}
@ -2219,8 +2219,9 @@ int main(int argc, char *argv[])
} else if (strcmp(argv[i], "--") == 0) {
i++;
break;
} else
usage();
} else {
cmdline_error("unknown option \"%s\"", argv[i]);
}
}
argc -= i;
argv += i;