@@ -69,34 +69,35 @@ func (p *buildParams) regoVersion() ast.RegoVersion {
6969 return ast .DefaultRegoVersion
7070}
7171
72- func init () {
72+ func initBuild (root * cobra.Command , brand string ) {
73+ executable := root .Name ()
7374
7475 buildParams := newBuildParams ()
7576
7677 var buildCommand = & cobra.Command {
7778 Use : "build <path> [<path> [...]]" ,
78- Short : " Build an OPA bundle" ,
79- Long : `Build an OPA bundle.
79+ Short : ` Build an ` + brand + ` bundle` ,
80+ Long : `Build an ` + brand + ` bundle.
8081
81- The 'build' command packages OPA policy and data files into bundles. Bundles are
82+ The 'build' command packages ` + brand + ` policy and data files into bundles. Bundles are
8283gzipped tarballs containing policies and data. Paths referring to directories are
8384loaded recursively.
8485
8586 $ ls
8687 example.rego
8788
88- $ opa build -b .
89+ $ ` + executable + ` build -b .
8990
90- You can load bundles into OPA on the command-line:
91+ You can load bundles into ` + brand + ` on the command-line:
9192
9293 $ ls
9394 bundle.tar.gz example.rego
9495
95- $ opa run bundle.tar.gz
96+ $ ` + executable + ` run bundle.tar.gz
9697
97- You can also configure OPA to download bundles from remote HTTP endpoints:
98+ You can also configure ` + brand + ` to download bundles from remote HTTP endpoints:
9899
99- $ opa run --server \
100+ $ ` + executable + ` run --server \
100101 --set bundles.example.resource=bundle.tar.gz \
101102 --set services.example.url=http://localhost:8080
102103
@@ -136,9 +137,9 @@ The 'build' command supports targets (specified by -t):
136137 original policy or data files.
137138
138139 plan The plan target emits a bundle containing a plan, i.e., an intermediate
139- representation compiled from the input files for each specified entrypoint.
140- This is for further processing, OPA cannot evaluate a "plan bundle" like it
141- can evaluate a wasm or rego bundle.
140+ representation compiled from the input files for each specified entrypoint.
141+ This is for further processing, ` + brand + ` cannot evaluate a "plan bundle" like it
142+ can evaluate a wasm or rego bundle.
142143
143144The -e flag tells the 'build' command which documents (entrypoints) will be queried by
144145the software asking for policy decisions, so that it can focus optimization efforts and
@@ -161,7 +162,7 @@ https://www.openpolicyagent.org/docs/latest/management-bundles/#signing.
161162
162163Example:
163164
164- $ opa build --verification-key /path/to/public_key.pem --signing-key /path/to/private_key.pem --bundle foo
165+ $ ` + executable + ` build --verification-key /path/to/public_key.pem --signing-key /path/to/private_key.pem --bundle foo
165166
166167Where foo has the following structure:
167168
@@ -196,7 +197,7 @@ see https://www.openpolicyagent.org/docs/latest/management-bundles/#signature-fo
196197Capabilities
197198------------
198199
199- The 'build' command can validate policies against a configurable set of OPA capabilities.
200+ The 'build' command can validate policies against a configurable set of ` + brand + ` capabilities.
200201The capabilities define the built-in functions and other language features that policies
201202may depend on. For example, the following capabilities file only permits the policy to
202203depend on the "plus" built-in function ('+'):
@@ -224,12 +225,12 @@ depend on the "plus" built-in function ('+'):
224225 ]
225226 }
226227
227- Capabilities can be used to validate policies against a specific version of OPA .
228- The OPA repository contains a set of capabilities files for each OPA release. For example,
228+ Capabilities can be used to validate policies against a specific version of ` + brand + ` .
229+ The ` + brand + ` repository contains a set of capabilities files for each ` + brand + ` release. For example,
229230the following command builds a directory of policies ('./policies') and validates them
230- against OPA v0.22.0:
231+ against ` + brand + ` v0.22.0:
231232
232- opa build ./policies --capabilities v0.22.0
233+ ` + executable + ` build ./policies --capabilities v0.22.0
233234` ,
234235 PreRunE : func (Cmd * cobra.Command , args []string ) error {
235236 if len (args ) == 0 {
@@ -279,7 +280,7 @@ against OPA v0.22.0:
279280 addV0CompatibleFlag (buildCommand .Flags (), & buildParams .v0Compatible , false )
280281 addV1CompatibleFlag (buildCommand .Flags (), & buildParams .v1Compatible , false )
281282
282- RootCommand .AddCommand (buildCommand )
283+ root .AddCommand (buildCommand )
283284}
284285
285286func dobuild (params buildParams , args []string ) error {
0 commit comments