2014-08-01 13:34:06 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2015-05-05 00:18:28 -04:00
|
|
|
"path/filepath"
|
|
|
|
|
|
|
|
"github.com/docker/docker/cli"
|
2016-02-19 17:42:51 -05:00
|
|
|
cliflags "github.com/docker/docker/cli/flags"
|
2015-05-05 00:18:28 -04:00
|
|
|
"github.com/docker/docker/cliconfig"
|
|
|
|
flag "github.com/docker/docker/pkg/mflag"
|
2016-02-01 14:36:40 -05:00
|
|
|
"github.com/docker/docker/utils"
|
2014-08-01 13:34:06 -04:00
|
|
|
)
|
|
|
|
|
2016-02-19 17:42:51 -05:00
|
|
|
var (
|
|
|
|
commonFlags = cliflags.InitCommonFlags()
|
|
|
|
clientFlags = &cli.ClientFlags{FlagSet: new(flag.FlagSet), Common: commonFlags}
|
|
|
|
)
|
2015-05-05 00:18:28 -04:00
|
|
|
|
|
|
|
func init() {
|
2016-02-19 17:42:51 -05:00
|
|
|
|
2015-05-05 00:18:28 -04:00
|
|
|
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 == "" {
|
2016-02-19 17:42:51 -05:00
|
|
|
clientFlags.Common.TrustKey = filepath.Join(cliconfig.ConfigDir(), cliflags.DefaultTrustKeyFile)
|
2015-05-05 00:18:28 -04:00
|
|
|
}
|
2016-02-01 14:36:40 -05:00
|
|
|
|
|
|
|
if clientFlags.Common.Debug {
|
|
|
|
utils.EnableDebug()
|
|
|
|
}
|
2015-05-05 00:18:28 -04:00
|
|
|
}
|
2014-08-01 13:34:06 -04:00
|
|
|
}
|