summaryrefslogtreecommitdiff
path: root/src/cmdline.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmdline.c')
-rw-r--r--src/cmdline.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/src/cmdline.c b/src/cmdline.c
index 6b7f0c8..e401729 100644
--- a/src/cmdline.c
+++ b/src/cmdline.c
@@ -54,8 +54,8 @@ const char *gengetopt_args_info_help[] = {
" --cacert=file CA certificate to verify peer against (SSL)",
" -E, --cert=file Client certificate file and password (SSL)",
" --key=key Private key file name (SSL)",
+ " -D, --digest Use digest auth on http authentication",
" --protocol=protocol The protocol to use (http, ftp) (possible\n values=\"http\", \"ftp\" default=`http')",
- " -d, --digest Use digest auth on http authentication",
0
};
@@ -131,8 +131,8 @@ void clear_given (struct gengetopt_args_info *args_info)
args_info->cacert_given = 0 ;
args_info->cert_given = 0 ;
args_info->key_given = 0 ;
- args_info->protocol_given = 0 ;
args_info->digest_given = 0 ;
+ args_info->protocol_given = 0 ;
}
static
@@ -167,6 +167,7 @@ void clear_args (struct gengetopt_args_info *args_info)
args_info->key_orig = NULL;
args_info->protocol_arg = gengetopt_strdup ("http");
args_info->protocol_orig = NULL;
+
}
static
@@ -197,8 +198,8 @@ void init_args_info(struct gengetopt_args_info *args_info)
args_info->cacert_help = gengetopt_args_info_help[18] ;
args_info->cert_help = gengetopt_args_info_help[19] ;
args_info->key_help = gengetopt_args_info_help[20] ;
- args_info->protocol_help = gengetopt_args_info_help[21] ;
- args_info->digest_help = gengetopt_args_info_help[22] ;
+ args_info->digest_help = gengetopt_args_info_help[21] ;
+ args_info->protocol_help = gengetopt_args_info_help[22] ;
}
@@ -438,10 +439,10 @@ cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
write_into_file(outfile, "cert", args_info->cert_orig, 0);
if (args_info->key_given)
write_into_file(outfile, "key", args_info->key_orig, 0);
- if (args_info->protocol_given)
- write_into_file(outfile, "protocol", args_info->protocol_orig, cmdline_parser_protocol_values);
if (args_info->digest_given)
write_into_file(outfile, "digest", 0, 0 );
+ if (args_info->protocol_given)
+ write_into_file(outfile, "protocol", args_info->protocol_orig, cmdline_parser_protocol_values);
i = EXIT_SUCCESS;
@@ -1411,8 +1412,8 @@ cmdline_parser_internal (
{ "cacert", 1, NULL, 0 },
{ "cert", 1, NULL, 'E' },
{ "key", 1, NULL, 0 },
+ { "digest", 0, NULL, 'D' },
{ "protocol", 1, NULL, 0 },
- { "digest", 0, NULL, 'd' },
{ 0, 0, 0, 0 }
};
@@ -1421,7 +1422,7 @@ cmdline_parser_internal (
custom_opterr = opterr;
custom_optopt = optopt;
- c = custom_getopt_long (argc, argv, "hVvt:c:w:H:I:p:u:f:a:s:SA:E:d", long_options, &option_index);
+ c = custom_getopt_long (argc, argv, "hVvt:c:w:H:I:p:u:f:a:s:SA:E:D", long_options, &option_index);
optarg = custom_optarg;
optind = custom_optind;
@@ -1579,18 +1580,6 @@ cmdline_parser_internal (
goto failure;
break;
- case 'd': /* Connect via SSL. Port defaults to 443. */
-
-
- if (update_arg( 0 ,
- 0 , &(args_info->digest_given),
- &(local_args_info.digest_given), optarg, 0, 0, ARG_NO,
- check_ambiguity, override, 0, 0,
- "digest", 'd',
- additional_error))
- goto failure;
-
- break;
case 'A': /* String to be sent in http header as \"User Agent\". */
@@ -1615,6 +1604,18 @@ cmdline_parser_internal (
goto failure;
break;
+ case 'D': /* Use digest auth on http authentication. */
+
+
+ if (update_arg( 0 ,
+ 0 , &(args_info->digest_given),
+ &(local_args_info.digest_given), optarg, 0, 0, ARG_NO,
+ check_ambiguity, override, 0, 0,
+ "digest", 'D',
+ additional_error))
+ goto failure;
+
+ break;
case 0: /* Long option with no short option */
/* The optional configuration file. */