/
commands.go
41 lines (33 loc) · 920 Bytes
/
commands.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package debug
import (
"fmt"
"github.com/urfave/cli"
cliutils "github.com/rocket-pool/smartnode/shared/utils/cli"
)
// Register subcommands
func RegisterSubcommands(command *cli.Command, name string, aliases []string) {
command.Subcommands = append(command.Subcommands, cli.Command{
Name: name,
Aliases: aliases,
Usage: "Debugging and troubleshooting commands",
Subcommands: []cli.Command{
{
Name: "export-validators",
Aliases: []string{"x"},
Usage: "Exports a TSV file of validators",
UsageText: "rocketpool api debug export-validators",
Action: func(c *cli.Context) error {
// Validate args
if err := cliutils.ValidateArgCount(c, 0); err != nil {
return err
}
// Export TSV of validators
if err := ExportValidators(c); err != nil {
fmt.Printf("An error occurred: %s\n", err)
}
return nil
},
},
},
})
}