Commit e4827025 authored by Matt Johnston's avatar Matt Johnston
Browse files

Warn rather than fail if flags have trailing parts

parent 00798ca8
......@@ -220,8 +220,9 @@ void cli_getopts(int argc, char ** argv) {
/* A flag *waves* */
char c = argv[i][1];
if (strlen(argv[i]) != 2) {
/* Ensure only one flag per hyphen. '?' falls through to print help */
c = '?';
/* We only handle one flag per hyphen */
fprintf(stderr, "Warning, trailing '%s' of '%s' is ignored.\n",
&argv[i][2], argv[i]);
}
switch (c) {
case 'y': /* always accept the remote hostkey */
......
......@@ -191,8 +191,9 @@ void svr_getopts(int argc, char ** argv) {
if (argv[i][0] == '-') {
char c = argv[i][1];
if (strlen(argv[i]) != 2) {
/* Ensure only one flag per hyphen. '?' falls through to print help */
c = '?';
/* We only handle one flag per hyphen */
fprintf(stderr, "Warning, trailing '%s' of '%s' is ignored.\n",
&argv[i][2], argv[i]);
}
switch (c) {
case 'b':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment