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"
|
|
|
|
"github.com/docker/docker/cliconfig"
|
|
|
|
flag "github.com/docker/docker/pkg/mflag"
|
2014-08-01 13:34:06 -04:00
|
|
|
)
|
|
|
|
|
2015-05-05 00:18:28 -04:00
|
|
|
var clientFlags = &cli.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(), defaultTrustKeyFile)
|
|
|
|
}
|
|
|
|
}
|
2014-08-01 13:34:06 -04:00
|
|
|
}
|