summaryrefslogtreecommitdiffstats
path: root/util/argconfig.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-04-07 12:43:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-04-07 12:43:34 +0000
commit8e1dcd44fcad7826e5f8fa6c5caa6c23989518d9 (patch)
tree8a5e1e9d02b2562d57d57ef88e26d4778ebeeab3 /util/argconfig.h
parentReleasing debian version 2.4+really2.3-2. (diff)
downloadnvme-cli-8e1dcd44fcad7826e5f8fa6c5caa6c23989518d9.tar.xz
nvme-cli-8e1dcd44fcad7826e5f8fa6c5caa6c23989518d9.zip
Merging upstream version 2.4+really2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'util/argconfig.h')
-rw-r--r--util/argconfig.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/util/argconfig.h b/util/argconfig.h
index 6ef3b6a..81eaaf4 100644
--- a/util/argconfig.h
+++ b/util/argconfig.h
@@ -38,6 +38,7 @@
#include <getopt.h>
#include <stdarg.h>
#include <stdio.h>
+#include <stdbool.h>
enum argconfig_types {
CFG_FLAG,
@@ -62,7 +63,7 @@ enum argconfig_types {
};
#define OPT_ARGS(n) \
- const struct argconfig_commandline_options n[]
+ struct argconfig_commandline_options n[]
#define OPT_END() { NULL }
@@ -109,6 +110,7 @@ struct argconfig_commandline_options {
void *default_value;
int argument_type;
const char *help;
+ bool seen;
};
#define CFG_MAX_SUBOPTS 500
@@ -117,9 +119,9 @@ struct argconfig_commandline_options {
typedef void argconfig_help_func();
void argconfig_append_usage(const char *str);
void argconfig_print_help(const char *program_desc,
- const struct argconfig_commandline_options *options);
+ struct argconfig_commandline_options *options);
int argconfig_parse(int argc, char *argv[], const char *program_desc,
- const struct argconfig_commandline_options *options);
+ struct argconfig_commandline_options *options);
int argconfig_parse_subopt_string(char *string, char **options,
size_t max_options);
int argconfig_parse_comma_sep_array(char *string, int *ret,
@@ -133,4 +135,7 @@ int argconfig_parse_byte(const char *opt, const char *str, unsigned char *val);
void argconfig_register_help_func(argconfig_help_func * f);
void print_word_wrapped(const char *s, int indent, int start, FILE *stream);
+bool argconfig_parse_seen(struct argconfig_commandline_options *options,
+ const char *option);
+bool argconfig_output_format_json(bool set);
#endif