summaryrefslogtreecommitdiffstats
path: root/apps/include/opt.h
diff options
context:
space:
mode:
authorJon Spillett <jon.spillett@oracle.com>2019-09-19 21:14:21 +1000
committerShane Lontis <shane.lontis@oracle.com>2019-09-19 21:14:21 +1000
commit4ed838915be263b3ebf847b6ada2ab2d3debec4c (patch)
treec6b311ad2ed74f58538c8276efe6564144474f61 /apps/include/opt.h
parent3837c202b5e91f009d1508a8f3608c94515ca776 (diff)
Add option grouping capability to apps
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9920)
Diffstat (limited to 'apps/include/opt.h')
-rw-r--r--apps/include/opt.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/include/opt.h b/apps/include/opt.h
index 81faf7057d..92a7fd1d82 100644
--- a/apps/include/opt.h
+++ b/apps/include/opt.h
@@ -266,6 +266,7 @@
*/
extern const char OPT_HELP_STR[];
extern const char OPT_MORE_STR[];
+extern const char OPT_SECTION_STR[];
typedef struct options_st {
const char *name;
int retval;
@@ -307,6 +308,9 @@ typedef struct string_int_pair_st {
OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NSS | \
OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK)
+/* Divide options into sections when displaying usage */
+#define OPT_SECTION(sec) {OPT_SECTION_STR, 1, '-', sec " options:\n"}
+
char *opt_progname(const char *argv0);
char *opt_getprog(void);
char *opt_init(int ac, char **av, const OPTIONS * o);
@@ -338,6 +342,7 @@ int opt_num_rest(void);
int opt_verify(int i, X509_VERIFY_PARAM *vpm);
int opt_rand(int i);
void opt_help(const OPTIONS * list);
+void opt_print(const OPTIONS * opt, int width);
int opt_format_error(const char *s, unsigned long flags);
int opt_isdir(const char *name);
int opt_printf_stderr(const char *fmt, ...);