if (err)
goto ret;
- if (!opts[1].seen) {
+ if (!argconfig_parse_seen(opts, "namespace-id")) {
err = nvme_get_nsid(dev_fd(dev), &cfg.namespace_id);
if (err < 0) {
if (errno != ENOTTY) {
if (err)
goto ret;
- if (!opts[0].seen) {
+ if (!argconfig_parse_seen(opts, "namespace-id")) {
err = nvme_get_nsid(dev_fd(dev), &cfg.namespace_id);
if (err < 0) {
if (errno != ENOTTY) {
if (err)
return err;
- if (opts[0].seen)
+ if (argconfig_parse_seen(opts, "mode"))
err = eol_plp_failure_mode_set(dev, nsid, fid, cfg.mode,
- cfg.save, !opts[3].seen);
+ cfg.save,
+ !argconfig_parse_seen(opts, "no-uuid"));
else
err = eol_plp_failure_mode_get(dev, nsid, fid, cfg.sel);
}
}
}
+
+bool argconfig_parse_seen(struct argconfig_commandline_options *options,
+ const char *option)
+{
+ struct argconfig_commandline_options *s;
+
+ for (s = options; s && s->option; s++) {
+ if (!strcmp(s->option, option))
+ return s->seen;;
+ }
+
+ return false;
+}
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);
#endif