aboutsummaryrefslogtreecommitdiff
path: root/src/nix-instantiate/nix-instantiate.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-06-27 11:36:23 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-06-27 11:36:23 +0200
commite477f0e9385d7825f005b7e9a32cd3ad6ee27aab (patch)
tree406115e6f38c7d2776f839fc4b60df801b250980 /src/nix-instantiate/nix-instantiate.cc
parent858b8f9760a81540b0a95068d96dc5c1628673c3 (diff)
Style fix
Diffstat (limited to 'src/nix-instantiate/nix-instantiate.cc')
-rw-r--r--src/nix-instantiate/nix-instantiate.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc
index 7acc9d501..a188b28fe 100644
--- a/src/nix-instantiate/nix-instantiate.cc
+++ b/src/nix-instantiate/nix-instantiate.cc
@@ -14,12 +14,6 @@
#include <map>
#include <iostream>
-enum OutputKind {
- OUTPUT_PLAIN,
- OUTPUT_XML,
- OUTPUT_JSON,
-};
-
using namespace nix;
@@ -42,6 +36,9 @@ static int rootNr = 0;
static bool indirectRoot = false;
+enum OutputKind { okPlain, okXML, okJSON };
+
+
void processExpr(EvalState & state, const Strings & attrPaths,
bool parseOnly, bool strict, Bindings & autoArgs,
bool evalOnly, OutputKind output, bool location, Expr * e)
@@ -65,9 +62,9 @@ void processExpr(EvalState & state, const Strings & attrPaths,
vRes = v;
else
state.autoCallFunction(autoArgs, v, vRes);
- if (output == OUTPUT_XML)
+ if (output == okXML)
printValueAsXML(state, strict, location, vRes, std::cout, context);
- else if (output == OUTPUT_JSON)
+ else if (output == okJSON)
printValueAsJSON(state, strict, vRes, std::cout, context);
else {
if (strict) state.strictForceValue(vRes);
@@ -117,7 +114,7 @@ void run(Strings args)
bool findFile = false;
bool evalOnly = false;
bool parseOnly = false;
- OutputKind outputKind = OUTPUT_PLAIN;
+ OutputKind outputKind = okPlain;
bool xmlOutputSourceLocation = true;
bool strict = false;
Strings attrPaths;
@@ -154,9 +151,9 @@ void run(Strings args)
else if (arg == "--indirect")
indirectRoot = true;
else if (arg == "--xml")
- outputKind = OUTPUT_XML;
+ outputKind = okXML;
else if (arg == "--json")
- outputKind = OUTPUT_JSON;
+ outputKind = okJSON;
else if (arg == "--no-location")
xmlOutputSourceLocation = false;
else if (arg == "--strict")