cmdline parse: only single letter options have single-letter strings

... moved around options so that parsing the code to find all
single-letter options easier.
This commit is contained in:
Daniel Stenberg 2016-04-28 22:24:10 +02:00
parent 7028ed6d31
commit 388c6b5e75
1 changed files with 8 additions and 9 deletions

View File

@ -64,9 +64,9 @@ struct LongShort {
}; };
static const struct LongShort aliases[]= { static const struct LongShort aliases[]= {
/* all these ones, starting with "*" or "$" as a short-option have *no* /* 'letter' strings with more than one character have *no* short option to
short option to mention. */ mention. */
{"*", "url", TRUE}, {"*@", "url", TRUE},
{"*4", "dns-ipv4-addr", TRUE}, {"*4", "dns-ipv4-addr", TRUE},
{"*6", "dns-ipv6-addr", TRUE}, {"*6", "dns-ipv6-addr", TRUE},
{"*a", "random-file", TRUE}, {"*a", "random-file", TRUE},
@ -114,6 +114,7 @@ static const struct LongShort aliases[]= {
{"*Z", "eprt", FALSE}, {"*Z", "eprt", FALSE},
/* 'eprt' made like this to make --no-eprt and --eprt to work /* 'eprt' made like this to make --no-eprt and --eprt to work
although --disable-eprt is the documented option */ although --disable-eprt is the documented option */
{"*~", "xattr", FALSE},
{"$a", "ftp-ssl", FALSE}, {"$a", "ftp-ssl", FALSE},
/* 'ftp-ssl' deprecated name since 7.20.0 */ /* 'ftp-ssl' deprecated name since 7.20.0 */
{"$a", "ssl", FALSE}, {"$a", "ssl", FALSE},
@ -284,7 +285,6 @@ static const struct LongShort aliases[]= {
{"z", "time-cond", TRUE}, {"z", "time-cond", TRUE},
{"#", "progress-bar", FALSE}, {"#", "progress-bar", FALSE},
{":", "next", FALSE}, {":", "next", FALSE},
{"~", "xattr", FALSE},
}; };
/* Split the argument of -E to 'certname' and 'passphrase' separated by colon. /* Split the argument of -E to 'certname' and 'passphrase' separated by colon.
@ -723,8 +723,10 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
case 'Z': /* --eprt */ case 'Z': /* --eprt */
config->disable_eprt = (!toggle)?TRUE:FALSE; config->disable_eprt = (!toggle)?TRUE:FALSE;
break; break;
case '~': /* --xattr */
default: /* the URL! */ config->xattr = toggle;
break;
case '@': /* the URL! */
{ {
struct getout *url; struct getout *url;
if(config->url_get || ((config->url_get = config->url_list) != NULL)) { if(config->url_get || ((config->url_get = config->url_list) != NULL)) {
@ -1026,9 +1028,6 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
break; break;
case ':': /* --next */ case ':': /* --next */
return PARAM_NEXT_OPERATION; return PARAM_NEXT_OPERATION;
case '~': /* --xattr */
config->xattr = toggle;
break;
case '0': /* --http* options */ case '0': /* --http* options */
switch(subletter) { switch(subletter) {
case '\0': case '\0':