| 137 | } |
| 138 | |
| 139 | func (*FixCommand) Help() string { |
| 140 | helpText := ` |
| 141 | Usage: packer fix [options] TEMPLATE |
| 142 | |
| 143 | Reads the JSON template and attempts to fix known backwards |
| 144 | incompatibilities. The fixed template will be outputted to standard out. |
| 145 | |
| 146 | If the template cannot be fixed due to an error, the command will exit |
| 147 | with a non-zero exit status. Error messages will appear on standard error. |
| 148 | |
| 149 | Fixes that are run (in order): |
| 150 | |
| 151 | ` |
| 152 | |
| 153 | for _, name := range fix.FixerOrder { |
| 154 | helpText += fmt.Sprintf( |
| 155 | " %-27s%s\n", name, fix.Fixers[name].Synopsis()) |
| 156 | } |
| 157 | |
| 158 | helpText += ` |
| 159 | Options: |
| 160 | |
| 161 | -validate=true If true (default), validates the fixed template. |
| 162 | ` |
| 163 | |
| 164 | return strings.TrimSpace(helpText) |
| 165 | } |
| 166 | |
| 167 | func (c *FixCommand) Synopsis() string { |
| 168 | return "fixes templates from old versions of packer" |