2016-04-23 21:31:57 -04:00
|
|
|
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()
|
2016-04-21 17:51:28 -04:00
|
|
|
clientFlags = &cliflags.ClientFlags{FlagSet: new(flag.FlagSet), Common: commonFlags}
|
2016-04-23 21:31:57 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
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()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|