aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2017-08-17 17:31:33 +0200
committerGravatar Irina Iancu <elenairina@google.com>2017-08-18 09:01:01 +0200
commit7321812d556f659b65952d5205250230e19d76cb (patch)
tree7c746eef7274122e1cc02cd7fad7f42b50438b24 /src/main
parentcf2dca1271e8d853616f72f2dd078d1e97613056 (diff)
Categorize query options.
PiperOrigin-RevId: 165581746
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/google/devtools/build/lib/query2/output/QueryOptions.java80
-rw-r--r--src/main/java/com/google/devtools/common/options/OptionDocumentationCategory.java3
2 files changed, 43 insertions, 40 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/query2/output/QueryOptions.java b/src/main/java/com/google/devtools/build/lib/query2/output/QueryOptions.java
index d528332fbd..8bf163d6f0 100644
--- a/src/main/java/com/google/devtools/build/lib/query2/output/QueryOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/query2/output/QueryOptions.java
@@ -46,8 +46,8 @@ public class QueryOptions extends OptionsBase {
name = "output",
defaultValue = "label",
category = "query",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.QUERY,
+ effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
help =
"The format in which the query results should be printed. Allowed values are: "
+ "label, label_kind, minrank, maxrank, package, location, graph, xml, proto, record."
@@ -59,8 +59,8 @@ public class QueryOptions extends OptionsBase {
defaultValue = "null",
category = "query",
expansion = {"--line_terminator_null=true"},
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.QUERY,
+ effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
help = "Whether each format is terminated with \0 instead of newline."
)
public Void isNull;
@@ -69,8 +69,8 @@ public class QueryOptions extends OptionsBase {
name = "line_terminator_null",
defaultValue = "false",
category = "query",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.QUERY,
+ effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
help = "Whether each format is terminated with \0 instead of newline."
)
public boolean lineTerminatorNull;
@@ -81,8 +81,8 @@ public class QueryOptions extends OptionsBase {
category = "query",
deprecationWarning = "Please use --order_output=auto or --order_output=no instead of this flag",
expansion = {"--order_output=auto"},
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.QUERY,
+ effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
help =
"Output the results in dependency-ordered (default) or unordered fashion. The "
+ "unordered output is faster but only supported when --output is not minrank, "
@@ -96,8 +96,8 @@ public class QueryOptions extends OptionsBase {
category = "query",
deprecationWarning = "Please use --order_output=no or --order_output=auto instead of this flag",
expansion = {"--order_output=no"},
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.QUERY,
+ effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
help =
"Output the results in dependency-ordered (default) or unordered fashion. The "
+ "unordered output is faster but only supported when --output is not minrank, "
@@ -118,8 +118,8 @@ public class QueryOptions extends OptionsBase {
converter = OrderOutputConverter.class,
defaultValue = "auto",
category = "query",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.QUERY,
+ effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
help =
"Output the results unordered (no), dependency-ordered (deps), or fully ordered (full). "
+ "The default is 'auto', meaning that results are output either dependency-ordered or "
@@ -135,8 +135,8 @@ public class QueryOptions extends OptionsBase {
abbrev = 'k',
defaultValue = "false",
category = "strategy",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.EXECUTION_STRATEGY,
+ effectTags = {OptionEffectTag.EAGERNESS_TO_EXIT},
help =
"Continue as much as possible after an error. While the target that failed, and those "
+ "that depend on it, cannot be analyzed, other prerequisites of these targets can be."
@@ -146,8 +146,8 @@ public class QueryOptions extends OptionsBase {
@Option(
name = "loading_phase_threads",
defaultValue = "200",
- documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.EXECUTION_STRATEGY,
+ effectTags = {OptionEffectTag.BAZEL_INTERNAL_CONFIGURATION},
help = "Number of parallel threads to use for the loading phase."
)
public int loadingPhaseThreads;
@@ -156,8 +156,8 @@ public class QueryOptions extends OptionsBase {
name = "host_deps",
defaultValue = "true",
category = "query",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.QUERY,
+ effectTags = {OptionEffectTag.BUILD_FILE_SEMANTICS},
help =
"If enabled, dependencies on 'host configuration' targets will be included in the "
+ "dependency graph over which the query operates. A 'host configuration' dependency "
@@ -174,8 +174,8 @@ public class QueryOptions extends OptionsBase {
name = "implicit_deps",
defaultValue = "true",
category = "query",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.QUERY,
+ effectTags = {OptionEffectTag.BUILD_FILE_SEMANTICS},
help =
"If enabled, implicit dependencies will be included in the dependency graph over "
+ "which the query operates. An implicit dependency is one that is not explicitly "
@@ -187,8 +187,8 @@ public class QueryOptions extends OptionsBase {
name = "graph:node_limit",
defaultValue = "512",
category = "query",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.QUERY,
+ effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
help =
"The maximum length of the label string for a graph node in the output. Longer labels"
+ " will be truncated; -1 means no truncation. This option is only applicable to"
@@ -200,8 +200,8 @@ public class QueryOptions extends OptionsBase {
name = "graph:factored",
defaultValue = "true",
category = "query",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.QUERY,
+ effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
help =
"If true, then the graph will be emitted 'factored', i.e. topologically-equivalent nodes "
+ "will be merged together and their labels concatenated. This option is only "
@@ -213,8 +213,8 @@ public class QueryOptions extends OptionsBase {
name = "proto:default_values",
defaultValue = "true",
category = "query",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.QUERY,
+ effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
help =
"If true, attributes whose value is not explicitly specified in the BUILD file are "
+ "included; otherwise they are omitted. This option is applicable to --output=proto"
@@ -225,8 +225,8 @@ public class QueryOptions extends OptionsBase {
name = "xml:line_numbers",
defaultValue = "true",
category = "query",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.QUERY,
+ effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
help =
"If true, XML output contains line numbers. Disabling this option may make diffs easier "
+ "to read. This option is only applicable to --output=xml."
@@ -237,8 +237,8 @@ public class QueryOptions extends OptionsBase {
name = "xml:default_values",
defaultValue = "false",
category = "query",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.QUERY,
+ effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
help =
"If true, rule attributes whose value is not explicitly specified in the BUILD file are "
+ "printed; otherwise they are omitted."
@@ -249,8 +249,8 @@ public class QueryOptions extends OptionsBase {
name = "strict_test_suite",
defaultValue = "false",
category = "query",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.QUERY,
+ effectTags = {OptionEffectTag.BUILD_FILE_SEMANTICS},
help =
"If true, the tests() expression gives an error if it encounters a test_suite containing "
+ "non-test targets."
@@ -262,8 +262,8 @@ public class QueryOptions extends OptionsBase {
converter = Converters.CommaSeparatedOptionListConverter.class,
defaultValue = "",
category = "query",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.QUERY,
+ effectTags = {OptionEffectTag.CHANGES_INPUTS},
help =
"A comma-separated set of target patterns (additive and subtractive). The query may "
+ "be performed in the universe defined by the transitive closure of the specified "
@@ -275,8 +275,8 @@ public class QueryOptions extends OptionsBase {
name = "relative_locations",
defaultValue = "false",
category = "query",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.QUERY,
+ effectTags = {OptionEffectTag.TERMINAL_OUTPUT},
help =
"If true, the location of BUILD files in xml and proto outputs will be relative. "
+ "By default, the location output is an absolute path and will not be consistent "
@@ -290,8 +290,8 @@ public class QueryOptions extends OptionsBase {
converter = AspectResolutionModeConverter.class,
defaultValue = "conservative",
category = "query",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.QUERY,
+ effectTags = {OptionEffectTag.BUILD_FILE_SEMANTICS},
help =
"How to resolve aspect dependencies when the output format is one of {xml,proto,record}. "
+ "'off' means no aspect dependencies are resolved, 'conservative' (the default) means "
@@ -309,8 +309,8 @@ public class QueryOptions extends OptionsBase {
name = "query_file",
defaultValue = "",
category = "query",
- documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
- effectTags = {OptionEffectTag.UNKNOWN},
+ documentationCategory = OptionDocumentationCategory.QUERY,
+ effectTags = {OptionEffectTag.CHANGES_INPUTS},
help =
"If set, query will read the query from the file named here, rather than on the command "
+ "line. It is an error to specify a file here as well as a command-line query."
diff --git a/src/main/java/com/google/devtools/common/options/OptionDocumentationCategory.java b/src/main/java/com/google/devtools/common/options/OptionDocumentationCategory.java
index 2354abf075..e288b13e57 100644
--- a/src/main/java/com/google/devtools/common/options/OptionDocumentationCategory.java
+++ b/src/main/java/com/google/devtools/common/options/OptionDocumentationCategory.java
@@ -90,4 +90,7 @@ public enum OptionDocumentationCategory {
* based on execution-environment requirements.
*/
TOOLCHAIN,
+
+ /** This option relates to query output and semantics. */
+ QUERY,
}