summaryrefslogtreecommitdiff
path: root/usr.bin/openssl/apps.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2014-08-28 13:37:42 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2014-08-28 13:37:42 +0000
commitb8c8d8939c63274e3bc008ff6bacb0502fba0743 (patch)
tree10ddfd16f2efe1787eba7b34accf0ad08b4e6ee5 /usr.bin/openssl/apps.c
parent2320d1fc469bf61427542270ac19c23c60ba4f81 (diff)
Add option handling for input/output formats.
Diffstat (limited to 'usr.bin/openssl/apps.c')
-rw-r--r--usr.bin/openssl/apps.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/openssl/apps.c b/usr.bin/openssl/apps.c
index fc5e2d073ae..4ae6f12c18c 100644
--- a/usr.bin/openssl/apps.c
+++ b/usr.bin/openssl/apps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apps.c,v 1.3 2014/08/27 15:51:41 jsing Exp $ */
+/* $OpenBSD: apps.c,v 1.4 2014/08/28 13:37:41 jsing Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
@@ -2277,6 +2277,7 @@ options_parse(int argc, char **argv, struct option *opts, char **unnamed)
continue;
if (opt->type == OPTION_ARG ||
+ opt->type == OPTION_ARG_FORMAT ||
opt->type == OPTION_ARG_INT) {
if (++i >= argc) {
fprintf(stderr,
@@ -2291,6 +2292,10 @@ options_parse(int argc, char **argv, struct option *opts, char **unnamed)
*opt->opt.arg = argv[i];
break;
+ case OPTION_ARG_FORMAT:
+ *opt->opt.value = str2fmt(argv[i]);
+ break;
+
case OPTION_ARG_INT:
val = strtonum(argv[i], 0, INT_MAX, &errstr);
if (errstr != NULL) {