add machine readable to the cli help func and docs (#10658)

This commit is contained in:
Megan Marsh 2021-02-19 02:17:47 -08:00 committed by GitHub
parent 317e2da000
commit dd167925d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View File

@ -92,6 +92,7 @@ Options:
-syntax-only Only check syntax. Do not verify config of the template.
-except=foo,bar,baz Validate all builds other than these.
-machine-readable Produce machine-readable output.
-only=foo,bar,baz Validate only these builds.
-var 'key=value' Variable for templates, can be used multiple times.
-var-file=path JSON or HCL2 file containing user variables.
@ -110,10 +111,11 @@ func (*ValidateCommand) AutocompleteArgs() complete.Predictor {
func (*ValidateCommand) AutocompleteFlags() complete.Flags {
return complete.Flags{
"-syntax-only": complete.PredictNothing,
"-except": complete.PredictNothing,
"-only": complete.PredictNothing,
"-var": complete.PredictNothing,
"-var-file": complete.PredictNothing,
"-syntax-only": complete.PredictNothing,
"-except": complete.PredictNothing,
"-only": complete.PredictNothing,
"-var": complete.PredictNothing,
"-machine-readable": complete.PredictNothing,
"-var-file": complete.PredictNothing,
}
}

View File

@ -40,6 +40,9 @@ Errors validating build 'vmware'. 1 error(s) occurred:
names. Build names by default are the names of their builders, unless a
specific `name` attribute is specified within the configuration.
- `-machine-readable` Sets all output to become machine-readable on stdout.
Logging, if enabled, continues to appear on stderr.
- `-var` - Set a variable in your packer template. This option can be used
multiple times. This is useful for setting version numbers for your build.