diff options
author | Alasdair G Kergon <agk@redhat.com> | 2017-08-05 16:18:36 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2017-08-05 16:23:34 +0100 |
commit | fe423ef583a48ca0f780156ec5f1fe33716318ad (patch) | |
tree | ee436470649c8503b4fe0b51faa6f0e0add2bb7e /tools/dumpconfig.c | |
parent | 827be01758ec5adb7b9d5ea75b658092adc65534 (diff) | |
download | lvm2-fe423ef583a48ca0f780156ec5f1fe33716318ad.tar.gz |
lvmconfig: Add options to produce file preamble
Use --withgeneralpreamble and --withlocalpreamble instead of
concatenating files.
Diffstat (limited to 'tools/dumpconfig.c')
-rw-r--r-- | tools/dumpconfig.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/dumpconfig.c b/tools/dumpconfig.c index e387e60a0..9e4408e16 100644 --- a/tools/dumpconfig.c +++ b/tools/dumpconfig.c @@ -234,6 +234,14 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv) log_error("--withcomments has no effect with --type list"); return EINVALID_CMD_LINE; } + if (arg_is_set(cmd, withlocalpreamble_ARG)) { + log_error("--withlocalpreamble has no effect with --type list"); + return EINVALID_CMD_LINE; + } + if (arg_is_set(cmd, withgeneralpreamble_ARG)) { + log_error("--withgeneralpreamble has no effect with --type list"); + return EINVALID_CMD_LINE; + } /* list type does not require status check */ } else if (!strcmp(type, "full")) { tree_spec.type = CFG_DEF_TREE_FULL; @@ -293,14 +301,22 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv) if (arg_is_set(cmd, withsummary_ARG) || arg_is_set(cmd, list_ARG)) tree_spec.withsummary = 1; + if (arg_is_set(cmd, withcomments_ARG)) tree_spec.withcomments = 1; + if (arg_is_set(cmd, unconfigured_ARG)) tree_spec.unconfigured = 1; if (arg_is_set(cmd, withversions_ARG)) tree_spec.withversions = 1; + if (arg_is_set(cmd, withgeneralpreamble_ARG)) + tree_spec.withgeneralpreamble = 1; + + if (arg_is_set(cmd, withlocalpreamble_ARG)) + tree_spec.withlocalpreamble = 1; + if (arg_is_set(cmd, withspaces_ARG)) tree_spec.withspaces = 1; |