Skip to content

Commit

Permalink
feat: add help info-keys topic
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed Sep 6, 2021
1 parent 7ab48b0 commit d672949
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 2 deletions.
7 changes: 6 additions & 1 deletion cmd/aspect/root/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,14 @@ func NewRootCmd(streams ioutils.Streams, defaultInteractive bool) *cobra.Command
// https://pkg.go.dev/github.com/spf13/cobra#Command.IsAdditionalHelpTopicCommand
cmd.AddCommand(&cobra.Command{
Use: "target-syntax",
Short: "Documentation on Bazel's syntax for targets",
Short: "Explains the syntax for specifying targets.",
Long: topics.Read("target-syntax"),
})
cmd.AddCommand(&cobra.Command{
Use: "info-keys",
Short: "Displays a list of keys used by the info command.",
Long: topics.Read("info-keys"),
})

return cmd
}
5 changes: 4 additions & 1 deletion docs/help/topics/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "topics",
srcs = ["main.go"],
data = ["target-syntax"],
data = [
"info-keys",
"target-syntax",
],
importpath = "aspect.build/cli/docs/help/topics",
visibility = ["//visibility:public"],
deps = ["@io_bazel_rules_go//go/tools/bazel:go_default_library"],
Expand Down
30 changes: 30 additions & 0 deletions docs/help/topics/info-keys
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
bazel-bin Configuration dependent directory for binaries.
bazel-genfiles Configuration dependent directory for generated files.
bazel-testlogs Configuration dependent directory for logs from a test run.
build-language A protobuffer with the build language structure
character-encoding Information about the character encoding used by the running JVM.
client-env The specifications that need to be added to the project-specific rc file to freeze the current client environment
command_log Location of the log containing the output from the build commands.
committed-heap-size The amount of memory in bytes that is committed for the Java virtual machine to use
default-package-path The default package path
defaults-package Obsolete. Retained for backwards compatibility.
execution_root A directory that makes all input and output files visible to the build.
gc-count Number of garbage collection runs.
gc-time The approximate accumulated time spend on garbage collection.
install_base The installation base directory.
java-home Location of the current Java runtime.
java-runtime Name and version of the current Java runtime environment.
java-vm Name and version of the current Java virtual machine.
max-heap-size The maximum amount of memory in bytes that can be used for memory management.
output_base A directory for shared bazel state as well as tool and strategy specific subdirectories.
output_path Output directory
package_path The search path for resolving package labels.
peak-heap-size The peak amount of used memory in bytes after any call to System.gc().
release bazel release identifier
repository_cache The location of the repository download cache used
server_log bazel server log path
server_pid bazel process id
starlark-semantics The effective set of Starlark semantics option values.
used-heap-size The amount of used memory in bytes. Note that this is not a good indicator of the actual memory use, as it includes any remaining inaccessible memory.
used-heap-size-after-gc The amount of used memory in bytes after a call to System.gc().
workspace The working directory of the server.
6 changes: 6 additions & 0 deletions integration_tests/help_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ help=$($ASPECT help target-syntax 2>/dev/null) || true
echo "$help"
exit 1
}
help=$($ASPECT help info-keys 2>/dev/null) || true
[[ "$help" =~ "bazel-bin" ]] || {
echo >&2 "Expected 'aspect help info-keys' stdout to contain 'bazel-bin' , but was"
echo "$help"
exit 1
}

0 comments on commit d672949

Please sign in to comment.