From b8c8d8939c63274e3bc008ff6bacb0502fba0743 Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Thu, 28 Aug 2014 13:37:42 +0000 Subject: Add option handling for input/output formats. --- usr.bin/openssl/apps.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'usr.bin/openssl/apps.c') 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 * @@ -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) { -- cgit v1.2.3