diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-08-16T10·32+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-08-16T10·32+0000 |
commit | 18e4ac0fc6bd1bc01d92d011e4629cacc3bec016 (patch) | |
tree | d9dccd46943c3d68595a2fc45f9ca77be776dc67 /src/nix-env | |
parent | fe101fa7851c3eccb79441ed7f5805e13934254f (diff) |
* `nix-instantiate --{eval|parse}-only --xml': print an XML
representation instead of an ATerm. * Indent XML output.
Diffstat (limited to 'src/nix-env')
-rw-r--r-- | src/nix-env/main.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nix-env/main.cc b/src/nix-env/main.cc index 7ec2667e75c8..0fb115533f18 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<DrvInfo>::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) { |