comparison cli-runopts.c @ 105:68b84c20ca1e

Fix for "-l" scp option
author Matt Johnston <matt@ucc.asn.au>
date Tue, 24 Aug 2004 05:05:48 +0000
parents c85c88500ea6
children 6b306ad5f5b5
comparison
equal deleted inserted replaced
104:298098b2a61e 105:68b84c20ca1e
141 } 141 }
142 142
143 if (argv[i][0] == '-') { 143 if (argv[i][0] == '-') {
144 /* A flag *waves* */ 144 /* A flag *waves* */
145 145
146 if (strlen(argv[i]) > 2) {
147 fprintf(stderr,
148 "WARNING: Ignoring unknown argument '%s'\n", argv[i]);
149 continue;
150 }
151
152 switch (argv[i][1]) { 146 switch (argv[i][1]) {
153 case 'p': /* remoteport */ 147 case 'p': /* remoteport */
154 next = &cli_opts.remoteport; 148 next = &cli_opts.remoteport;
155 break; 149 break;
156 #ifdef ENABLE_CLI_PUBKEY_AUTH 150 #ifdef ENABLE_CLI_PUBKEY_AUTH
203 default: 197 default:
204 fprintf(stderr, 198 fprintf(stderr,
205 "WARNING: Ignoring unknown argument '%s'\n", argv[i]); 199 "WARNING: Ignoring unknown argument '%s'\n", argv[i]);
206 break; 200 break;
207 } /* Switch */ 201 } /* Switch */
202
203 /* Now we handle args where they might be "-luser" (no spaces)*/
204 if (next && strlen(argv[i]) > 2) {
205 *next = &argv[i][2];
206 next = NULL;
207 }
208 208
209 continue; /* next argument */ 209 continue; /* next argument */
210 210
211 } else { 211 } else {
212 TRACE(("non-flag arg: '%s'", argv[i])); 212 TRACE(("non-flag arg: '%s'", argv[i]));