From dd167925d751b8739b27d2f0708cf56239140ea0 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Fri, 19 Feb 2021 02:17:47 -0800 Subject: [PATCH] add machine readable to the cli help func and docs (#10658) --- command/validate.go | 12 +++++++----- website/content/docs/commands/validate.mdx | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/command/validate.go b/command/validate.go index 3e406a425..910682dba 100644 --- a/command/validate.go +++ b/command/validate.go @@ -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, } } diff --git a/website/content/docs/commands/validate.mdx b/website/content/docs/commands/validate.mdx index 5083fb401..90680f1c3 100644 --- a/website/content/docs/commands/validate.mdx +++ b/website/content/docs/commands/validate.mdx @@ -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.