From 18e4ac0fc6bd1bc01d92d011e4629cacc3bec016 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 16 Aug 2006 10:32:30 +0000 Subject: * `nix-instantiate --{eval|parse}-only --xml': print an XML representation instead of an ATerm. * Indent XML output. --- src/nix-env/main.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/nix-env') diff --git a/src/nix-env/main.cc b/src/nix-env/main.cc index 7ec2667e75..0fb115533f 100644 --- a/src/nix-env/main.cc +++ b/src/nix-env/main.cc @@ -804,7 +804,7 @@ static void opQuery(Globals & globals, /* Print the desired columns, or XML output. */ Table table; ostringstream dummy; - XMLWriter xml(*(xmlOutput ? &cout : &dummy)); + XMLWriter xml(true, *(xmlOutput ? &cout : &dummy)); XMLOpenElement xmlRoot(xml, "items"); for (vector::iterator i = elems2.begin(); @@ -903,10 +903,9 @@ static void opQuery(Globals & globals, columns.push_back(descr); } - if (xmlOutput) { + if (xmlOutput) xml.writeEmptyElement("item", attrs); - xml.writeCharData("\n"); - } else + else table.push_back(columns); } catch (AssertionError & e) { -- cgit 1.4.1