To handle incremental order value, added new option type OPTION_ORDER.
openssl(1) x509 requires this option handling, since,
- -CA and -signkey require to set both filename and incremental 'num'.
- -dates requires to set two variables in a row, startdate and enddate.
and this couldn't be solved by OPTION_FLAG_ORD.
ok tb@ and "I'd move forward with your current plan." from jsing@
-/* $OpenBSD: apps.c,v 1.58 2021/03/17 18:08:32 jsing Exp $ */
+/* $OpenBSD: apps.c,v 1.59 2021/03/24 12:07:39 inoguchi Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
*opt->opt.ulvalue |= opt->ulvalue;
break;
+ case OPTION_ORDER:
+ *opt->opt.order = ++(*opt->order);
+ break;
+
default:
fprintf(stderr, "option %s - unknown type %i\n",
opt->name, opt->type);
-/* $OpenBSD: apps.h,v 1.24 2020/09/09 12:47:46 inoguchi Exp $ */
+/* $OpenBSD: apps.h,v 1.25 2021/03/24 12:07:39 inoguchi Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
OPTION_VALUE_AND,
OPTION_VALUE_OR,
OPTION_UL_VALUE_OR,
+ OPTION_ORDER,
} type;
union {
char **arg;
int *value;
unsigned long *ulvalue;
time_t *tvalue;
+ int *order;
} opt;
const int value;
const unsigned long ulvalue;
+ int *order;
};
void options_usage(const struct option *opts);