static int _should_skip_def_node(struct config_def_tree_spec *spec, int section_id, cfg_def_item_t *def)
{
- if (def->parent != section_id)
+ if ((def->parent != section_id) ||
+ (spec->ignoreadvanced && def->flags & CFG_ADVANCED) ||
+ (spec->ignoreunsupported && def->flags & CFG_UNSUPPORTED))
return 1;
switch (spec->type) {
arg(configtype_ARG, '\0', "type", string_arg, 0)
arg(withcomments_ARG, '\0', "withcomments", NULL, 0)
arg(withversions_ARG, '\0', "withversions", NULL, 0)
+arg(ignoreadvanced_ARG, '\0', "ignoreadvanced", NULL, 0)
+arg(ignoreunsupported_ARG, '\0', "ignoreunsupported", NULL, 0)
arg(atversion_ARG, '\0', "atversion", string_arg, 0)
arg(validate_ARG, '\0', "validate", NULL, 0)
"\t[--type {current|default|missing|new} \n"
"\t[--withcomments] \n"
"\t[--withversions] \n"
+ "\t[--ignoreadvanced] \n"
+ "\t[--ignoreunsupported] \n"
"\t[--atversion version]] \n"
"\t[--validate]\n"
"\t[ConfigurationNode...]\n",
file_ARG, configtype_ARG, withcomments_ARG, atversion_ARG,
- withversions_ARG, validate_ARG)
+ withversions_ARG, ignoreadvanced_ARG, ignoreunsupported_ARG,
+ validate_ARG)
xx(formats,
"List available metadata formats",
return EINVALID_CMD_LINE;
}
+ if (arg_count(cmd, ignoreadvanced_ARG))
+ tree_spec.ignoreadvanced = 1;
+
+ if (arg_count(cmd, ignoreunsupported_ARG))
+ tree_spec.ignoreunsupported = 1;
+
if (arg_count(cmd, validate_ARG)) {
if (config_def_check(cmd, 1, 1, 0)) {
log_print("LVM configuration valid.");
return EINVALID_CMD_LINE;
}
+ if ((tree_spec.ignoreadvanced || tree_spec.ignoreunsupported) &&
+ (tree_spec.type == CFG_DEF_TREE_CURRENT)) {
+ log_error("--ignoreadvanced and --ignoreunsupported has no effect with --type current");
+ return EINVALID_CMD_LINE;
+ }
+
if (tree_spec.type != CFG_DEF_TREE_CURRENT) {
if (!_get_vsn(cmd, &major, &minor, &patchlevel))
return EINVALID_CMD_LINE;