| 72 | } |
| 73 | |
| 74 | func (*FormatCommand) Help() string { |
| 75 | helpText := ` |
| 76 | Usage: packer fmt [options] [TEMPLATE] |
| 77 | |
| 78 | Rewrites all Packer configuration files to a canonical format. Both |
| 79 | configuration files (.pkr.hcl) and variable files (.pkrvars.hcl) are updated. |
| 80 | JSON files (.json) are not modified. |
| 81 | |
| 82 | If TEMPLATE is "." the current directory will be used. |
| 83 | If TEMPLATE is "-" then content will be read from STDIN. |
| 84 | |
| 85 | The given content must be in Packer's HCL2 configuration language; JSON is |
| 86 | not supported. |
| 87 | |
| 88 | Options: |
| 89 | -check Check if the input is formatted. Exit status will be 0 if all |
| 90 | input is properly formatted and non-zero otherwise. |
| 91 | |
| 92 | -diff Display diffs of formatting change |
| 93 | |
| 94 | -write=false Don't write to source files |
| 95 | (always disabled if using -check) |
| 96 | |
| 97 | -recursive Also process files in subdirectories. By default, only the |
| 98 | given directory (or current directory) is processed. |
| 99 | ` |
| 100 | |
| 101 | return strings.TrimSpace(helpText) |
| 102 | } |
| 103 | |
| 104 | func (*FormatCommand) Synopsis() string { |
| 105 | return "Rewrites HCL2 config files to canonical format" |