mirror of
https://github.com/docker/docs.git
synced 2026-04-12 06:19:22 +07:00
Move all flags into cli/flags Move usage help into cli/usage.go Signed-off-by: Daniel Nephin <dnephin@docker.com>
38 lines
878 B
Go
38 lines
878 B
Go
package main
|
|
|
|
import (
|
|
"path/filepath"
|
|
|
|
cliflags "github.com/docker/docker/cli/flags"
|
|
"github.com/docker/docker/cliconfig"
|
|
flag "github.com/docker/docker/pkg/mflag"
|
|
"github.com/docker/docker/utils"
|
|
)
|
|
|
|
var (
|
|
commonFlags = cliflags.InitCommonFlags()
|
|
clientFlags = &cliflags.ClientFlags{FlagSet: new(flag.FlagSet), Common: commonFlags}
|
|
)
|
|
|
|
func init() {
|
|
|
|
client := clientFlags.FlagSet
|
|
client.StringVar(&clientFlags.ConfigDir, []string{"-config"}, cliconfig.ConfigDir(), "Location of client config files")
|
|
|
|
clientFlags.PostParse = func() {
|
|
clientFlags.Common.PostParse()
|
|
|
|
if clientFlags.ConfigDir != "" {
|
|
cliconfig.SetConfigDir(clientFlags.ConfigDir)
|
|
}
|
|
|
|
if clientFlags.Common.TrustKey == "" {
|
|
clientFlags.Common.TrustKey = filepath.Join(cliconfig.ConfigDir(), cliflags.DefaultTrustKeyFile)
|
|
}
|
|
|
|
if clientFlags.Common.Debug {
|
|
utils.EnableDebug()
|
|
}
|
|
}
|
|
}
|