about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-18T13·48+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-18T13·48+0200
commit02843ba4cb041992535c28b266796f75646544b5 (patch)
tree78528a9ce95b7790f4b022366f8279f3119243b4
parent632f989b51985a0036fca5502d9a341b7cded324 (diff)
Fix --attr parsing
-rw-r--r--src/nix-env/nix-env.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc
index e65dc4e51a64..44296c7b62ed 100644
--- a/src/nix-env/nix-env.cc
+++ b/src/nix-env/nix-env.cc
@@ -1402,7 +1402,9 @@ int main(int argc, char * * argv)
                 repair = true;
             else if (*arg != "" && arg->at(0) == '-') {
                 opFlags.push_back(*arg);
-                if (*arg == "--from-profile" || *arg == "--atr" || *arg == "-A") /* !!! hack */
+                /* FIXME: hacky */
+                if (*arg == "--from-profile" ||
+                    (op == opQuery && (*arg == "--attr" || *arg == "-A")))
                     opFlags.push_back(getArg(*arg, arg, end));
             }
             else