[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
32/118: Style fix
From: |
Ludovic Courtès |
Subject: |
32/118: Style fix |
Date: |
Tue, 19 May 2015 14:45:26 +0000 |
civodul pushed a commit to branch nix
in repository guix.
commit e477f0e9385d7825f005b7e9a32cd3ad6ee27aab
Author: Eelco Dolstra <address@hidden>
Date: Fri Jun 27 11:36:23 2014 +0200
Style fix
---
src/nix-instantiate/nix-instantiate.cc | 19 ++++++++-----------
1 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/src/nix-instantiate/nix-instantiate.cc
b/src/nix-instantiate/nix-instantiate.cc
index 7acc9d5..a188b28 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")
- 22/118: Share code between scopedImport and import, (continued)
- 22/118: Share code between scopedImport and import, Ludovic Courtès, 2015/05/19
- 26/118: Don't use member initialisers, Ludovic Courtès, 2015/05/19
- 31/118: Add `--json` argument to `nix-instantiate`, Ludovic Courtès, 2015/05/19
- 18/118: Print a warning when loading a large path into memory, Ludovic Courtès, 2015/05/19
- 27/118: Add importNative primop, Ludovic Courtès, 2015/05/19
- 24/118: Drop ImportError and FindError, Ludovic Courtès, 2015/05/19
- 28/118: Only add the importNative primop if the allow-arbitrary-code-during-evaluation option is true (default false), Ludovic Courtès, 2015/05/19
- 30/118: allow-arbitrary-code-during-evaluation -> allow-unsafe-native-code-during-evaluation, Ludovic Courtès, 2015/05/19
- 34/118: Add builtin function ‘fromJSON’, Ludovic Courtès, 2015/05/19
- 36/118: Fix compilation error on some versions of GCC, Ludovic Courtès, 2015/05/19
- 32/118: Style fix,
Ludovic Courtès <=
- 46/118: Fix use of sysread, Ludovic Courtès, 2015/05/19
- 33/118: Manual: html -> xhtml, Ludovic Courtès, 2015/05/19
- 45/118: nix-copy-closure -s: Do substitutions via ‘nix-store --serve’, Ludovic Courtès, 2015/05/19
- 40/118: Remove maybeVfork, Ludovic Courtès, 2015/05/19
- 50/118: Fix closure size display, Ludovic Courtès, 2015/05/19
- 38/118: Fix security hole in ‘nix-store --serve’, Ludovic Courtès, 2015/05/19
- 43/118: Remove tabs, Ludovic Courtès, 2015/05/19
- 35/118: Don't build on Ubuntu 10.10, Ludovic Courtès, 2015/05/19
- 44/118: nix-copy-closure: Fix --dry-run, Ludovic Courtès, 2015/05/19
- 47/118: Replace message "importing path <...>" with "exporting path <...>", Ludovic Courtès, 2015/05/19