Mercurial > dropbear
comparison svr-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 | 8b6cba298768 |
comparison
equal
deleted
inserted
replaced
1159:f567a4152c14 | 1160:1b583b2994ba |
---|---|
189 } | 189 } |
190 | 190 |
191 if (argv[i][0] == '-') { | 191 if (argv[i][0] == '-') { |
192 char c = argv[i][1]; | 192 char c = argv[i][1]; |
193 if (strlen(argv[i]) != 2) { | 193 if (strlen(argv[i]) != 2) { |
194 /* Ensure only one flag per hyphen. '?' falls through to print help */ | 194 /* We only handle one flag per hyphen */ |
195 c = '?'; | 195 fprintf(stderr, "Warning, trailing '%s' of '%s' is ignored.\n", |
196 &argv[i][2], argv[i]); | |
196 } | 197 } |
197 switch (c) { | 198 switch (c) { |
198 case 'b': | 199 case 'b': |
199 next = &svr_opts.bannerfile; | 200 next = &svr_opts.bannerfile; |
200 break; | 201 break; |