mirror of https://github.com/docker/cli.git
Merge pull request #27864 from vdemeester/add-statsformat-to-configfile
Add StatsFormat to the config.json file
This commit is contained in:
commit
63719e1a24
|
@ -186,13 +186,17 @@ func runStats(dockerCli *command.DockerCli, opts *statsOptions) error {
|
||||||
|
|
||||||
// before print to screen, make sure each container get at least one valid stat data
|
// before print to screen, make sure each container get at least one valid stat data
|
||||||
waitFirst.Wait()
|
waitFirst.Wait()
|
||||||
f := "table"
|
format := opts.format
|
||||||
if len(opts.format) > 0 {
|
if len(format) == 0 {
|
||||||
f = opts.format
|
if len(dockerCli.ConfigFile().StatsFormat) > 0 {
|
||||||
|
format = dockerCli.ConfigFile().StatsFormat
|
||||||
|
} else {
|
||||||
|
format = formatter.TableFormatKey
|
||||||
|
}
|
||||||
}
|
}
|
||||||
statsCtx := formatter.Context{
|
statsCtx := formatter.Context{
|
||||||
Output: dockerCli.Out(),
|
Output: dockerCli.Out(),
|
||||||
Format: formatter.NewStatsFormat(f, daemonOSType),
|
Format: formatter.NewStatsFormat(format, daemonOSType),
|
||||||
}
|
}
|
||||||
cleanScreen := func() {
|
cleanScreen := func() {
|
||||||
if !opts.noStream {
|
if !opts.noStream {
|
||||||
|
|
Loading…
Reference in New Issue