mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Refactor dockerCli *Format to ConfigFile call
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
a488ad1a09
commit
7c8780ea63
5 changed files with 8 additions and 32 deletions
|
@ -118,30 +118,6 @@ func (cli *DockerCli) CheckTtyInput(attachStdin, ttyMode bool) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// PsFormat returns the format string specified in the configuration.
|
|
||||||
// String contains columns and format specification, for example {{ID}}\t{{Name}}.
|
|
||||||
func (cli *DockerCli) PsFormat() string {
|
|
||||||
return cli.configFile.PsFormat
|
|
||||||
}
|
|
||||||
|
|
||||||
// ImagesFormat returns the format string specified in the configuration.
|
|
||||||
// String contains columns and format specification, for example {{ID}}\t{{Name}}.
|
|
||||||
func (cli *DockerCli) ImagesFormat() string {
|
|
||||||
return cli.configFile.ImagesFormat
|
|
||||||
}
|
|
||||||
|
|
||||||
// NetworksFormat returns the format string specified in the configuration.
|
|
||||||
// String contains columns and format specification, for example {{ID}}\t{{Name}}
|
|
||||||
func (cli *DockerCli) NetworksFormat() string {
|
|
||||||
return cli.configFile.NetworksFormat
|
|
||||||
}
|
|
||||||
|
|
||||||
// VolumesFormat returns the format string specified in the configuration.
|
|
||||||
// String contains columns and format specification, for example {{ID}}\t{{Name}}
|
|
||||||
func (cli *DockerCli) VolumesFormat() string {
|
|
||||||
return cli.configFile.VolumesFormat
|
|
||||||
}
|
|
||||||
|
|
||||||
func (cli *DockerCli) setRawTerminal() error {
|
func (cli *DockerCli) setRawTerminal() error {
|
||||||
if os.Getenv("NORAW") == "" {
|
if os.Getenv("NORAW") == "" {
|
||||||
if cli.isTerminalIn {
|
if cli.isTerminalIn {
|
||||||
|
|
|
@ -101,8 +101,8 @@ func runPs(dockerCli *client.DockerCli, opts *psOptions) error {
|
||||||
|
|
||||||
f := opts.format
|
f := opts.format
|
||||||
if len(f) == 0 {
|
if len(f) == 0 {
|
||||||
if len(dockerCli.PsFormat()) > 0 && !opts.quiet {
|
if len(dockerCli.ConfigFile().PsFormat) > 0 && !opts.quiet {
|
||||||
f = dockerCli.PsFormat()
|
f = dockerCli.ConfigFile().PsFormat
|
||||||
} else {
|
} else {
|
||||||
f = "table"
|
f = "table"
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,8 +79,8 @@ func runImages(dockerCli *client.DockerCli, opts imagesOptions) error {
|
||||||
|
|
||||||
f := opts.format
|
f := opts.format
|
||||||
if len(f) == 0 {
|
if len(f) == 0 {
|
||||||
if len(dockerCli.ImagesFormat()) > 0 && !opts.quiet {
|
if len(dockerCli.ConfigFile().ImagesFormat) > 0 && !opts.quiet {
|
||||||
f = dockerCli.ImagesFormat()
|
f = dockerCli.ConfigFile().ImagesFormat
|
||||||
} else {
|
} else {
|
||||||
f = "table"
|
f = "table"
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,8 +71,8 @@ func runList(dockerCli *client.DockerCli, opts listOptions) error {
|
||||||
|
|
||||||
f := opts.format
|
f := opts.format
|
||||||
if len(f) == 0 {
|
if len(f) == 0 {
|
||||||
if len(dockerCli.NetworksFormat()) > 0 && !opts.quiet {
|
if len(dockerCli.ConfigFile().NetworksFormat) > 0 && !opts.quiet {
|
||||||
f = dockerCli.NetworksFormat()
|
f = dockerCli.ConfigFile().NetworksFormat
|
||||||
} else {
|
} else {
|
||||||
f = "table"
|
f = "table"
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,8 +68,8 @@ func runList(dockerCli *client.DockerCli, opts listOptions) error {
|
||||||
|
|
||||||
f := opts.format
|
f := opts.format
|
||||||
if len(f) == 0 {
|
if len(f) == 0 {
|
||||||
if len(dockerCli.VolumesFormat()) > 0 && !opts.quiet {
|
if len(dockerCli.ConfigFile().VolumesFormat) > 0 && !opts.quiet {
|
||||||
f = dockerCli.VolumesFormat()
|
f = dockerCli.ConfigFile().VolumesFormat
|
||||||
} else {
|
} else {
|
||||||
f = "table"
|
f = "table"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue