Blob Blame Raw
From ada0cd07eb449eb48b2fdf78f8e32f8a0a7199c9 Mon Sep 17 00:00:00 2001
From: Dominic Cleal <dcleal@redhat.com>
Date: Mon, 2 Jun 2014 16:05:30 +0100
Subject: [PATCH] * src/augrun.c: remove unused "filename" argument from
 dump-xml command

Fixes RHBZ#1100106

(cherry picked from commit e775e5f85183a76c584219b14963368a66171375)

Conflicts:
	NEWS
---
 man/augtool.pod |  5 ++---
 src/augrun.c    | 11 ++---------
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/man/augtool.pod b/man/augtool.pod
index 28f8563..44695ba 100644
--- a/man/augtool.pod
+++ b/man/augtool.pod
@@ -165,11 +165,10 @@ The following commands are used to retrieve data from the Augeas tree.
 
 =over 4
 
-=item B<dump-xml> I<[E<lt>PATHE<gt>]> I<[E<lt>FILENAMEE<gt>]>
+=item B<dump-xml> I<[E<lt>PATHE<gt>]>
 
 Print entries in the tree as XML. If PATH is given, printing starts there,
-otherwise the whole tree is printed. If FILENAME is given, the XML is saved
-to the given file.
+otherwise the whole tree is printed.
 
 =item B<get> E<lt>PATHE<gt>
 
diff --git a/src/augrun.c b/src/augrun.c
index 024d1fc..fd96409 100644
--- a/src/augrun.c
+++ b/src/augrun.c
@@ -895,30 +895,23 @@ static const struct command_def cmd_print_def = {
 
 static void cmd_dump_xml(struct command *cmd) {
     const char *path = arg_value(cmd, "path");
-    const char *filename = arg_value(cmd, "filename");
     xmlNodePtr xmldoc;
     int r;
 
     r = aug_to_xml(cmd->aug, path, &xmldoc, 0);
     if (r < 0)
         ERR_REPORT(cmd, AUG_ECMDRUN,
-                   "XML export of path %s to file %s failed", path, filename);
+                   "XML export of path %s failed", path);
 
     xmlElemDump(stdout, NULL, xmldoc);
     printf("\n");
 
-    if (filename != NULL) {
-        printf("Saving to %s\n", filename);
-    }
-
     xmlFreeNode(xmldoc);
 }
 
 static const struct command_opt_def cmd_dump_xml_opts[] = {
     { .type = CMD_PATH, .name = "path", .optional = true,
       .help = "print this subtree" },
-    { .type = CMD_NONE, .name = "filename", .optional = true,
-      .help = "save to this file" },
     CMD_OPT_DEF_LAST
 };
 
@@ -927,7 +920,7 @@ static const struct command_def cmd_dump_xml_def = {
     .opts = cmd_dump_xml_opts,
     .handler = cmd_dump_xml,
     .synopsis = "print a subtree as XML",
-    .help = "Export entries in the tree as XML. If PATH is given, printing starts there,\n otherwise the whole tree is printed. If FILENAME is given, the XML is saved\n to the given file."
+    .help = "Export entries in the tree as XML. If PATH is given, printing starts there,\n otherwise the whole tree is printed."
 };
 
 static void cmd_transform(struct command *cmd) {