diff cli-runopts.c @ 1160:1b583b2994ba

Warn rather than fail if flags have trailing parts
author Matt Johnston <matt@ucc.asn.au>
date Wed, 28 Oct 2015 21:37:35 +0800
parents 67d8a904f5a9
children ff9bd50f1457
line wrap: on
line diff
--- a/cli-runopts.c	Wed Oct 21 23:08:22 2015 +0800
+++ b/cli-runopts.c	Wed Oct 28 21:37:35 2015 +0800
@@ -220,8 +220,9 @@
 			/* 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 */