From 0b6ac712e3883cbf07cc2bb16dc77d0f10493bb1 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Thu, 1 Jan 2015 14:28:00 +0000 Subject: Provide option types for binary AND, binary OR and silently discarding an option. --- src/usr.bin/openssl/apps.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/usr.bin/openssl/apps.c') diff --git a/src/usr.bin/openssl/apps.c b/src/usr.bin/openssl/apps.c index d3c31947f3..5a6bb7a2ee 100644 --- a/src/usr.bin/openssl/apps.c +++ b/src/usr.bin/openssl/apps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apps.c,v 1.22 2014/12/28 16:51:31 jsing Exp $ */ +/* $OpenBSD: apps.c,v 1.23 2015/01/01 14:28:00 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -2359,6 +2359,14 @@ options_parse(int argc, char **argv, struct option *opts, char **unnamed, *opt->opt.value = opt->value; break; + case OPTION_VALUE_AND: + *opt->opt.value &= opt->value; + break; + + case OPTION_VALUE_OR: + *opt->opt.value |= opt->value; + break; + default: fprintf(stderr, "option %s - unknown type %i\n", opt->name, opt->type); -- cgit v1.2.3-55-g6feb