aboutsummaryrefslogtreecommitdiff
path: root/src/nix-env/nix-env.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-env/nix-env.cc')
-rw-r--r--src/nix-env/nix-env.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc
index a40d0c7e6..106dfe0b6 100644
--- a/src/nix-env/nix-env.cc
+++ b/src/nix-env/nix-env.cc
@@ -914,6 +914,8 @@ static void opQuery(Globals & globals, Strings opFlags, Strings opArgs)
throw UsageError(format("unknown flag '%1%'") % arg);
}
+ if (printAttrPath && source != sAvailable)
+ throw UsageError("--attr-path(-P) only works with --available");
/* Obtain derivation information from the specified source. */
DrvInfos availElems, installedElems;