mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdctlv3: support endpoint flag
This commit is contained in:
parent
1de63deca4
commit
121d2b9e9d
@ -44,7 +44,7 @@ func deleteRangeCommandFunc(c *cli.Context) {
|
||||
if len(c.Args()) > 1 {
|
||||
rangeEnd = []byte(c.Args()[1])
|
||||
}
|
||||
conn, err := grpc.Dial("127.0.0.1:12379")
|
||||
conn, err := grpc.Dial(c.GlobalString("endpoint"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ func putCommandFunc(c *cli.Context) {
|
||||
|
||||
key := []byte(c.Args()[0])
|
||||
value := []byte(c.Args()[1])
|
||||
conn, err := grpc.Dial("127.0.0.1:12379")
|
||||
conn, err := grpc.Dial(c.GlobalString("endpoint"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ func rangeCommandFunc(c *cli.Context) {
|
||||
if len(c.Args()) > 1 {
|
||||
rangeEnd = []byte(c.Args()[1])
|
||||
}
|
||||
conn, err := grpc.Dial("127.0.0.1:12379")
|
||||
conn, err := grpc.Dial(c.GlobalString("endpoint"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ func txnCommandFunc(c *cli.Context) {
|
||||
next = next(txn, reader)
|
||||
}
|
||||
|
||||
conn, err := grpc.Dial("127.0.0.1:12379")
|
||||
conn, err := grpc.Dial(c.GlobalString("endpoint"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -27,6 +27,9 @@ func main() {
|
||||
app.Name = "etcdctlv3"
|
||||
app.Version = version.Version
|
||||
app.Usage = "A simple command line client for etcd3."
|
||||
app.Flags = []cli.Flag{
|
||||
cli.StringFlag{Name: "endpoint", Value: "127.0.0.1:2378", Usage: "gRPC endpoint"},
|
||||
}
|
||||
app.Commands = []cli.Command{
|
||||
command.NewRangeCommand(),
|
||||
command.NewPutCommand(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user