mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 07:36:44 +00:00
Add default values
This commit is contained in:
parent
a22a68cdc2
commit
765a4b93d7
2 changed files with 8 additions and 9 deletions
|
|
@ -41,9 +41,10 @@ func (d *DebugCommand) Flags() *flagset.Flagset {
|
|||
flags := d.NewFlagSet("debug")
|
||||
|
||||
flags.Uint64Flag(&flagset.Uint64Flag{
|
||||
Name: "seconds",
|
||||
Usage: "seconds to trace",
|
||||
Value: &d.seconds,
|
||||
Name: "seconds",
|
||||
Usage: "seconds to trace",
|
||||
Value: &d.seconds,
|
||||
Default: 5,
|
||||
})
|
||||
flags.StringFlag(&flagset.StringFlag{
|
||||
Name: "output",
|
||||
|
|
|
|||
|
|
@ -97,17 +97,15 @@ func (m *Meta2) NewFlagSet(n string) *flagset.Flagset {
|
|||
f := flagset.NewFlagSet(n)
|
||||
|
||||
f.StringFlag(&flagset.StringFlag{
|
||||
Name: "address",
|
||||
Value: &m.addr,
|
||||
Usage: "Address of the grpc endpoint",
|
||||
Name: "address",
|
||||
Value: &m.addr,
|
||||
Usage: "Address of the grpc endpoint",
|
||||
Default: "127.0.0.1:3131",
|
||||
})
|
||||
return f
|
||||
}
|
||||
|
||||
func (m *Meta2) Conn() (*grpc.ClientConn, error) {
|
||||
if m.addr == "" {
|
||||
m.addr = "127.0.0.1:3131"
|
||||
}
|
||||
conn, err := grpc.Dial(m.addr, grpc.WithInsecure())
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to connect to server: %v", err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue