etcdctlv3: support endpoint flag
parent
1de63deca4
commit
121d2b9e9d
|
@ -44,7 +44,7 @@ func deleteRangeCommandFunc(c *cli.Context) {
|
||||||
if len(c.Args()) > 1 {
|
if len(c.Args()) > 1 {
|
||||||
rangeEnd = []byte(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 {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ func putCommandFunc(c *cli.Context) {
|
||||||
|
|
||||||
key := []byte(c.Args()[0])
|
key := []byte(c.Args()[0])
|
||||||
value := []byte(c.Args()[1])
|
value := []byte(c.Args()[1])
|
||||||
conn, err := grpc.Dial("127.0.0.1:12379")
|
conn, err := grpc.Dial(c.GlobalString("endpoint"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ func rangeCommandFunc(c *cli.Context) {
|
||||||
if len(c.Args()) > 1 {
|
if len(c.Args()) > 1 {
|
||||||
rangeEnd = []byte(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 {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ func txnCommandFunc(c *cli.Context) {
|
||||||
next = next(txn, reader)
|
next = next(txn, reader)
|
||||||
}
|
}
|
||||||
|
|
||||||
conn, err := grpc.Dial("127.0.0.1:12379")
|
conn, err := grpc.Dial(c.GlobalString("endpoint"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,9 @@ func main() {
|
||||||
app.Name = "etcdctlv3"
|
app.Name = "etcdctlv3"
|
||||||
app.Version = version.Version
|
app.Version = version.Version
|
||||||
app.Usage = "A simple command line client for etcd3."
|
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{
|
app.Commands = []cli.Command{
|
||||||
command.NewRangeCommand(),
|
command.NewRangeCommand(),
|
||||||
command.NewPutCommand(),
|
command.NewPutCommand(),
|
||||||
|
|
Loading…
Reference in New Issue