Skip to content

Commit 09ace63

Browse files
authored
Merge pull request #1043 from rocket-pool/urfave-v3
Migrate to urfav v3
2 parents 59f4d7a + 34ec2b6 commit 09ace63

File tree

214 files changed

+2696
-2291
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+2696
-2291
lines changed

go.mod

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ require (
4242
github.com/sethvargo/go-password v0.2.0
4343
github.com/shirou/gopsutil/v3 v3.23.1
4444
github.com/tyler-smith/go-bip39 v1.1.0
45-
github.com/urfave/cli v1.22.12
46-
github.com/urfave/cli/v2 v2.26.0
45+
github.com/urfave/cli/v3 v3.7.0
4746
github.com/wealdtech/go-ens/v3 v3.5.5
4847
github.com/wealdtech/go-eth2-types/v2 v2.8.1-0.20230131115251-b93cf60cee26
4948
github.com/wealdtech/go-eth2-util v1.8.0
@@ -75,7 +74,6 @@ require (
7574
github.com/consensys/bavard v0.1.13 // indirect
7675
github.com/consensys/gnark-crypto v0.12.1 // indirect
7776
github.com/containerd/log v0.1.0 // indirect
78-
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
7977
github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3 // indirect
8078
github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect
8179
github.com/cyphar/filepath-securejoin v0.2.5 // indirect
@@ -180,7 +178,6 @@ require (
180178
github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f // indirect
181179
github.com/x-cray/logrus-prefixed-formatter v0.5.2 // indirect
182180
github.com/xanzy/ssh-agent v0.3.3 // indirect
183-
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
184181
github.com/yusufpapurcu/wmi v1.2.3 // indirect
185182
go.mongodb.org/mongo-driver v1.13.1 // indirect
186183
go.opentelemetry.io/auto/sdk v1.1.0 // indirect

go.sum

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7
4343
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
4444
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
4545
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
46-
github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
4746
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
4847
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
4948
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
@@ -154,7 +153,6 @@ github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5U
154153
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
155154
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
156155
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
157-
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
158156
github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM=
159157
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
160158
github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3 h1:HVTnpeuvF6Owjd5mniCL8DEXo7uYXdQEmOP4FJbV5tg=
@@ -801,11 +799,12 @@ github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2n
801799
github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U=
802800
github.com/uber/jaeger-client-go v2.25.0+incompatible h1:IxcNZ7WRY1Y3G4poYlx24szfsn/3LvK9QHCq9oQw8+U=
803801
github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
802+
github.com/urfave/cli v1.22.10 h1:p8Fspmz3iTctJstry1PYS3HVdllxnEzTEsgIgtxTrCk=
804803
github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
805-
github.com/urfave/cli v1.22.12 h1:igJgVw1JdKH+trcLWLeLwZjU9fEfPesQ+9/e4MQ44S8=
806-
github.com/urfave/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN30b8=
807804
github.com/urfave/cli/v2 v2.26.0 h1:3f3AMg3HpThFNT4I++TKOejZO8yU55t3JnnSr4S4QEI=
808805
github.com/urfave/cli/v2 v2.26.0/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
806+
github.com/urfave/cli/v3 v3.7.0 h1:AGSnbUyjtLiM+WJUb4dzXKldl/gL+F8OwmRDtVr6g2U=
807+
github.com/urfave/cli/v3 v3.7.0/go.mod h1:ysVLtOEmg2tOy6PknnYVhDoouyC/6N42TMeoMzskhso=
809808
github.com/warpfork/go-testmark v0.11.0 h1:J6LnV8KpceDvo7spaNU4+DauH2n1x+6RaO2rJrmpQ9U=
810809
github.com/warpfork/go-testmark v0.11.0/go.mod h1:jhEf8FVxd+F17juRubpmut64NEG6I2rgkUhlcqqXwE0=
811810
github.com/warpfork/go-wish v0.0.0-20180510122957-5ad1f5abf436/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw=

rocketpool-cli/auction/commands.go

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
package auction
22

33
import (
4-
"github.com/urfave/cli"
4+
"context"
5+
6+
"github.com/urfave/cli/v3"
57

68
cliutils "github.com/rocket-pool/smartnode/shared/utils/cli"
79
)
810

911
// Register commands
10-
func RegisterCommands(app *cli.App, name string, aliases []string) {
11-
app.Commands = append(app.Commands, cli.Command{
12+
func RegisterCommands(app *cli.Command, name string, aliases []string) {
13+
app.Commands = append(app.Commands, &cli.Command{
1214
Name: name,
1315
Aliases: aliases,
1416
Usage: "Manage Rocket Pool RPL auctions",
15-
Subcommands: []cli.Command{
17+
Commands: []*cli.Command{
1618

1719
{
1820
Name: "status",
1921
Aliases: []string{"s"},
2022
Usage: "Get RPL auction status",
2123
UsageText: "rocketpool auction status",
22-
Action: func(c *cli.Context) error {
24+
Action: func(ctx context.Context, c *cli.Command) error {
2325

2426
// Validate args
2527
if err := cliutils.ValidateArgCount(c, 0); err != nil {
@@ -37,7 +39,7 @@ func RegisterCommands(app *cli.App, name string, aliases []string) {
3739
Aliases: []string{"l"},
3840
Usage: "Get RPL lots for auction",
3941
UsageText: "rocketpool auction lots",
40-
Action: func(c *cli.Context) error {
42+
Action: func(ctx context.Context, c *cli.Command) error {
4143

4244
// Validate args
4345
if err := cliutils.ValidateArgCount(c, 0); err != nil {
@@ -55,7 +57,7 @@ func RegisterCommands(app *cli.App, name string, aliases []string) {
5557
Aliases: []string{"t"},
5658
Usage: "Create a new lot",
5759
UsageText: "rocketpool auction create-lot",
58-
Action: func(c *cli.Context) error {
60+
Action: func(ctx context.Context, c *cli.Command) error {
5961

6062
// Validate args
6163
if err := cliutils.ValidateArgCount(c, 0); err != nil {
@@ -74,20 +76,23 @@ func RegisterCommands(app *cli.App, name string, aliases []string) {
7476
Usage: "Bid on a lot",
7577
UsageText: "rocketpool auction bid-lot [options]",
7678
Flags: []cli.Flag{
77-
cli.StringFlag{
78-
Name: "lot, l",
79-
Usage: "The ID of the lot to bid on",
79+
&cli.StringFlag{
80+
Name: "lot",
81+
Aliases: []string{"l"},
82+
Usage: "The ID of the lot to bid on",
8083
},
81-
cli.StringFlag{
82-
Name: "amount, a",
83-
Usage: "The amount of ETH to bid (or 'max')",
84+
&cli.StringFlag{
85+
Name: "amount",
86+
Aliases: []string{"a"},
87+
Usage: "The amount of ETH to bid (or 'max')",
8488
},
85-
cli.BoolFlag{
86-
Name: "yes, y",
87-
Usage: "Automatically confirm bid",
89+
&cli.BoolFlag{
90+
Name: "yes",
91+
Aliases: []string{"y"},
92+
Usage: "Automatically confirm bid",
8893
},
8994
},
90-
Action: func(c *cli.Context) error {
95+
Action: func(ctx context.Context, c *cli.Command) error {
9196

9297
// Validate args
9398
if err := cliutils.ValidateArgCount(c, 0); err != nil {
@@ -118,12 +123,13 @@ func RegisterCommands(app *cli.App, name string, aliases []string) {
118123
Usage: "Claim RPL from a lot",
119124
UsageText: "rocketpool auction claim-lot [options]",
120125
Flags: []cli.Flag{
121-
cli.StringFlag{
122-
Name: "lot, l",
123-
Usage: "The lot to claim RPL from (lot ID or 'all')",
126+
&cli.StringFlag{
127+
Name: "lot",
128+
Aliases: []string{"l"},
129+
Usage: "The lot to claim RPL from (lot ID or 'all')",
124130
},
125131
},
126-
Action: func(c *cli.Context) error {
132+
Action: func(ctx context.Context, c *cli.Command) error {
127133

128134
// Validate args
129135
if err := cliutils.ValidateArgCount(c, 0); err != nil {
@@ -149,12 +155,13 @@ func RegisterCommands(app *cli.App, name string, aliases []string) {
149155
Usage: "Recover unclaimed RPL from a lot (returning it to the auction contract)",
150156
UsageText: "rocketpool auction recover-lot [options]",
151157
Flags: []cli.Flag{
152-
cli.StringFlag{
153-
Name: "lot, l",
154-
Usage: "The lot to recover unclaimed RPL from (lot ID or 'all')",
158+
&cli.StringFlag{
159+
Name: "lot",
160+
Aliases: []string{"l"},
161+
Usage: "The lot to recover unclaimed RPL from (lot ID or 'all')",
155162
},
156163
},
157-
Action: func(c *cli.Context) error {
164+
Action: func(ctx context.Context, c *cli.Command) error {
158165

159166
// Validate args
160167
if err := cliutils.ValidateArgCount(c, 0); err != nil {

rocketpool-cli/claims/commands.go

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
package claims
22

33
import (
4-
"github.com/urfave/cli"
4+
"context"
5+
6+
"github.com/urfave/cli/v3"
57

68
cliutils "github.com/rocket-pool/smartnode/shared/utils/cli"
79
)
810

911
// Register commands
10-
func RegisterCommands(app *cli.App, name string, aliases []string) {
11-
app.Commands = append(app.Commands, cli.Command{
12+
func RegisterCommands(app *cli.Command, name string, aliases []string) {
13+
app.Commands = append(app.Commands, &cli.Command{
1214
Name: name,
1315
Aliases: aliases,
1416
Usage: "View and claim all available rewards and credits across the node",
15-
Subcommands: []cli.Command{
17+
Commands: []*cli.Command{
1618
{
1719
Name: "status",
1820
Aliases: []string{"s"},
1921
Usage: "Display all available rewards and credits across the node without claiming",
2022
UsageText: "rocketpool claims status",
21-
Action: func(c *cli.Context) error {
23+
Action: func(ctx context.Context, c *cli.Command) error {
2224
if err := cliutils.ValidateArgCount(c, 0); err != nil {
2325
return err
2426
}
@@ -31,16 +33,17 @@ func RegisterCommands(app *cli.App, name string, aliases []string) {
3133
Usage: "Display all available rewards and credits and claim them",
3234
UsageText: "rocketpool claims claim-all [options]",
3335
Flags: []cli.Flag{
34-
cli.BoolFlag{
35-
Name: "yes, y",
36-
Usage: "Automatically confirm all claims",
36+
&cli.BoolFlag{
37+
Name: "yes",
38+
Aliases: []string{"y"},
39+
Usage: "Automatically confirm all claims",
3740
},
38-
cli.StringFlag{
41+
&cli.StringFlag{
3942
Name: "restake-amount",
4043
Usage: "The amount of RPL to automatically restake during periodic reward claiming (or 'all')",
4144
},
4245
},
43-
Action: func(c *cli.Context) error {
46+
Action: func(ctx context.Context, c *cli.Command) error {
4447
if err := cliutils.ValidateArgCount(c, 0); err != nil {
4548
return err
4649
}

0 commit comments

Comments
 (0)