improve formatting and documentation for PR#6784

This commit is contained in:
Ashley Lowde 2018-10-02 20:00:45 +09:30
parent 12496e3702
commit 2884f6fab6
3 changed files with 11 additions and 11 deletions

View File

@ -309,7 +309,7 @@ Options:
-machine-readable Machine-readable output
-on-error=[cleanup|abort|ask] If the build fails do: clean up (default), abort, or ask
-parallel=false Disable parallelization (on by default)
-timestamp=true Enable timestamps in build log (off by default)
-timestamp-ui=true Prefix each ui output with an RFC3339 timestamp (off by default).
-var 'key=value' Variable for templates, can be used multiple times.
-var-file=path JSON file containing user variables.
`

View File

@ -99,14 +99,6 @@ type MachineReadableUi struct {
var _ Ui = new(MachineReadableUi)
// TimestampedUi is a UI that wraps another UI implementation and prefixes
// prefixes each message with an RFC3339 timestamp
type TimestampedUi struct {
Ui Ui
}
var _ Ui = new(TimestampedUi)
func (u *ColoredUi) Ask(query string) (string, error) {
return u.Ui.Ask(u.colorize(query, u.Color, true))
}
@ -351,6 +343,14 @@ func (u *MachineReadableUi) ProgressBar() ProgressBar {
return new(NoopProgressBar)
}
// TimestampedUi is a UI that wraps another UI implementation and prefixes
// prefixes each message with an RFC3339 timestamp
type TimestampedUi struct {
Ui Ui
}
var _ Ui = new(TimestampedUi)
func (u *TimestampedUi) Ask(query string) (string, error) {
return u.Ui.Ask(query)
}

View File

@ -50,8 +50,8 @@ that are created will be outputted at the end of the build.
- `-parallel=false` - Disable parallelization of multiple builders (on by
default).
- `-timestamp=true` - Enable timestamps for build logs without adding the extra
information included if PACKER_LOG is true.
- `-timestamp-ui=true` - Prefix each ui output with an RFC3339 timestamp (off
by default).
- `-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.