diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-03-13 19:26:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-13 19:26:20 +0100 |
commit | 779ef8f5ef18a74253b6b691c218203df1d23b75 (patch) | |
tree | 6fa72b7814cdd01f3cd2b63ccb0eb1eb5120d4a0 /src | |
parent | 59c37112a92b66663ac32a328f7b547f43bb2e72 (diff) | |
parent | b6d794fb8df09b9b5d86f3fe2a2789631215f8b5 (diff) |
Merge pull request #3380 from contrun/no-attr-path-for-installed
display attr-path only when queried available
Diffstat (limited to 'src')
-rw-r--r-- | src/nix-env/nix-env.cc | 2 |
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; |