# HG changeset patch # User Matt Johnston # Date 1446039455 -28800 # Node ID 1b583b2994baaa932f980a216344f35caf117e50 # Parent f567a4152c14f1ab8187e10ce5c87690862b38e5 Warn rather than fail if flags have trailing parts diff -r f567a4152c14 -r 1b583b2994ba cli-runopts.c --- 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 */ diff -r f567a4152c14 -r 1b583b2994ba svr-runopts.c --- a/svr-runopts.c Wed Oct 21 23:08:22 2015 +0800 +++ b/svr-runopts.c Wed Oct 28 21:37:35 2015 +0800 @@ -191,8 +191,9 @@ 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':