Merge pull request #4580 from AdoHe/etcdctl_use_endpoints

etcdctl: use endpoints instead of endpoint flag
This commit is contained in:
Xiang Li 2016-02-24 19:01:42 -08:00
commit 6053480b75
2 changed files with 12 additions and 3 deletions

View File

@ -66,7 +66,15 @@ func argOrStdin(args []string, stdin io.Reader, i int) (string, error) {
}
func getPeersFlagValue(c *cli.Context) []string {
peerstr := c.GlobalString("endpoint")
peerstr := c.GlobalString("endpoints")
if peerstr == "" {
peerstr = os.Getenv("ETCDCTL_ENDPOINTS")
}
if peerstr == "" {
peerstr = c.GlobalString("endpoint")
}
if peerstr == "" {
peerstr = os.Getenv("ETCDCTL_ENDPOINT")

View File

@ -34,8 +34,9 @@ func main() {
cli.BoolFlag{Name: "no-sync", Usage: "don't synchronize cluster information before sending request"},
cli.StringFlag{Name: "output, o", Value: "simple", Usage: "output response in the given format (`simple`, `extended` or `json`)"},
cli.StringFlag{Name: "discovery-srv, D", Usage: "domain name to query for SRV records describing cluster endpoints"},
cli.StringFlag{Name: "peers, C", Value: "", Usage: "DEPRECATED - \"--endpoint\" should be used instead"},
cli.StringFlag{Name: "endpoint", Value: "", Usage: "a comma-delimited list of machine addresses in the cluster (default: \"http://127.0.0.1:2379,http://127.0.0.1:4001\")"},
cli.StringFlag{Name: "peers, C", Value: "", Usage: "DEPRECATED - \"--endpoints\" should be used instead"},
cli.StringFlag{Name: "endpoint", Value: "", Usage: "DEPRECATED - \"--endpoints\" should be used instead"},
cli.StringFlag{Name: "endpoints", Value: "", Usage: "a comma-delimited list of machine addresses in the cluster (default: \"http://127.0.0.1:2379,http://127.0.0.1:4001\")"},
cli.StringFlag{Name: "cert-file", Value: "", Usage: "identify HTTPS client using this SSL certificate file"},
cli.StringFlag{Name: "key-file", Value: "", Usage: "identify HTTPS client using this SSL key file"},
cli.StringFlag{Name: "ca-file", Value: "", Usage: "verify certificates of HTTPS-enabled servers using this CA bundle"},