diff options
author | Alasdair Kergon <agk@redhat.com> | 2007-01-09 23:22:31 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2007-01-09 23:22:31 +0000 |
commit | 2eeb2a1f54c4c8201dd7183f653a6cb55834397d (patch) | |
tree | 66041698d1cfd8611b8b658be41dfb085c1ede46 /tools/dumpconfig.c | |
parent | 7c0cd2730c66681a799663a3c565732b28ac313b (diff) | |
download | lvm2-2eeb2a1f54c4c8201dd7183f653a6cb55834397d.tar.gz |
dumpconfig accepts a list of configuration variables to display.
Change dumpconfig to use --file to redirect output to a file.
Diffstat (limited to 'tools/dumpconfig.c')
-rw-r--r-- | tools/dumpconfig.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/tools/dumpconfig.c b/tools/dumpconfig.c index fdf49cb2f..d5b7a78c3 100644 --- a/tools/dumpconfig.c +++ b/tools/dumpconfig.c @@ -19,15 +19,10 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv) { const char *file = NULL; - if (argc == 1) - file = argv[0]; + if (arg_count(cmd, file_ARG)) + file = arg_str_value(cmd, file_ARG, ""); - if (argc > 1) { - log_error("Please specify one file for output"); - return EINVALID_CMD_LINE; - } - - if (!write_config_file(cmd->cft, file)) + if (!write_config_file(cmd->cft, file, argc, argv)) return ECMD_FAILED; return ECMD_PROCESSED; |