diff options
author | 2017-06-16 21:14:10 +0200 | |
---|---|---|
committer | 2017-06-19 18:23:44 +0200 | |
commit | 9e26369575f04776c0416fd75a9434a22b4d5e9a (patch) | |
tree | 6e7cb5b75d5d766586a3e9bf51bb5affee8e9e7d /src/main/java/com/google/devtools/build/lib/runtime | |
parent | b1b794ba78d9f1ccfd013fd56c62c737ec14a4d4 (diff) |
Ban the combination of buildfiles/loadfiles and --output=location.
RELNOTES[INC]: The --output=location flag to 'bazel query' cannot be used with query expressions that involve the 'buildfiles' or 'loadfiles' operators. This also applies to 'genquery' rules.
PiperOrigin-RevId: 159259061
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java index 47571ae9fd..8881db18ba 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java @@ -147,6 +147,14 @@ public final class QueryCommand implements BlazeCommand { .handle(Event.error(null, "Error while parsing '" + query + "': " + e.getMessage())); return ExitCode.COMMAND_LINE_ERROR; } + + try { + formatter.verifyCompatible(queryEnv, expr); + } catch (QueryException e) { + env.getReporter().handle(Event.error(e.getMessage())); + return ExitCode.COMMAND_LINE_ERROR; + } + expr = queryEnv.transformParsedQuery(expr); OutputStream out = env.getReporter().getOutErr().getOutputStream(); |