summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-08-28 13:39:07 +0000
committerjsing <jsing@openbsd.org>2014-08-28 13:39:07 +0000
commitf9a600f95d6423f9cc85151762d1b41662368858 (patch)
tree594d3c01e2dd55c80cd490c9b34a8de81b9b6747
parentAdd option handling for input/output formats. (diff)
downloadwireguard-openbsd-f9a600f95d6423f9cc85151762d1b41662368858.tar.xz
wireguard-openbsd-f9a600f95d6423f9cc85151762d1b41662368858.zip
Add option handling for ordered flags.
-rw-r--r--usr.bin/openssl/apps.c7
-rw-r--r--usr.bin/openssl/apps.h3
2 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/openssl/apps.c b/usr.bin/openssl/apps.c
index 4ae6f12c18c..f69613e5864 100644
--- a/usr.bin/openssl/apps.c
+++ b/usr.bin/openssl/apps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apps.c,v 1.4 2014/08/28 13:37:41 jsing Exp $ */
+/* $OpenBSD: apps.c,v 1.5 2014/08/28 13:39:07 jsing Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
@@ -2257,6 +2257,7 @@ options_parse(int argc, char **argv, struct option *opts, char **unnamed)
struct option *opt;
long long val;
char *arg, *p;
+ int ord = 0;
int i, j;
for (i = 1; i < argc; i++) {
@@ -2311,6 +2312,10 @@ options_parse(int argc, char **argv, struct option *opts, char **unnamed)
*opt->opt.flag = 1;
break;
+ case OPTION_FLAG_ORD:
+ *opt->opt.flag = ++ord;
+ break;
+
case OPTION_VALUE:
*opt->opt.value = opt->value;
break;
diff --git a/usr.bin/openssl/apps.h b/usr.bin/openssl/apps.h
index fefceb7ddb0..3ea855f6848 100644
--- a/usr.bin/openssl/apps.h
+++ b/usr.bin/openssl/apps.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: apps.h,v 1.4 2014/08/28 13:37:41 jsing Exp $ */
+/* $OpenBSD: apps.h,v 1.5 2014/08/28 13:39:07 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -291,6 +291,7 @@ struct option {
OPTION_ARG_FORMAT,
OPTION_ARG_INT,
OPTION_FLAG,
+ OPTION_FLAG_ORD,
OPTION_VALUE,
} type;
union {