mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdctl: suggest endpoint over peers flag
This commit is contained in:
parent
1124a06860
commit
8d8033df55
@ -59,10 +59,16 @@ func argOrStdin(args []string, stdin io.Reader, i int) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getPeersFlagValue(c *cli.Context) []string {
|
func getPeersFlagValue(c *cli.Context) []string {
|
||||||
peerstr := c.GlobalString("peers")
|
peerstr := c.GlobalString("endpoint")
|
||||||
|
|
||||||
|
if peerstr == "" {
|
||||||
|
peerstr = os.Getenv("ETCDCTL_ENDPOINT")
|
||||||
|
}
|
||||||
|
|
||||||
|
if peerstr == "" {
|
||||||
|
peerstr = c.GlobalString("peers")
|
||||||
|
}
|
||||||
|
|
||||||
// Use an environment variable if nothing was supplied on the
|
|
||||||
// command line
|
|
||||||
if peerstr == "" {
|
if peerstr == "" {
|
||||||
peerstr = os.Getenv("ETCDCTL_PEERS")
|
peerstr = os.Getenv("ETCDCTL_PEERS")
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,7 @@ func main() {
|
|||||||
cli.StringFlag{Name: "output, o", Value: "simple", Usage: "output response in the given format (`simple`, `extended` or `json`)"},
|
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: "discovery-srv, D", Usage: "domain name to query for SRV records describing cluster endpoints"},
|
||||||
cli.StringFlag{Name: "peers, C", Value: "", Usage: "a comma-delimited list of machine addresses in the cluster (default: \"http://127.0.0.1:4001,http://127.0.0.1:2379\")"},
|
cli.StringFlag{Name: "peers, C", Value: "", Usage: "a comma-delimited list of machine addresses in the cluster (default: \"http://127.0.0.1:4001,http://127.0.0.1:2379\")"},
|
||||||
|
cli.StringFlag{Name: "endpoint", Value: "", Usage: "a comma-delimited list of machine addresses in the cluster (default: \"http://127.0.0.1:4001,http://127.0.0.1:2379\")"},
|
||||||
cli.StringFlag{Name: "cert-file", Value: "", Usage: "identify HTTPS client using this SSL certificate file"},
|
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: "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"},
|
cli.StringFlag{Name: "ca-file", Value: "", Usage: "verify certificates of HTTPS-enabled servers using this CA bundle"},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user