-
Notifications
You must be signed in to change notification settings - Fork 0
/
show.go
41 lines (32 loc) · 773 Bytes
/
show.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 show
import (
"fmt"
"github.com/0xDaoChain/dao-chain/command"
"github.com/spf13/cobra"
)
func GetCommand() *cobra.Command {
showCmd := &cobra.Command{
Use: "show",
Short: "Displays whitelist information",
PreRunE: runPreRun,
Run: runCommand,
}
setFlags(showCmd)
return showCmd
}
func setFlags(cmd *cobra.Command) {
cmd.Flags().StringVar(
¶ms.genesisPath,
chainFlag,
fmt.Sprintf("./%s", command.DefaultGenesisFileName),
"the genesis file to update",
)
}
func runPreRun(_ *cobra.Command, _ []string) error {
return params.initRawParams()
}
func runCommand(cmd *cobra.Command, _ []string) {
outputter := command.InitializeOutputter(cmd)
defer outputter.WriteOutput()
outputter.SetCommandResult(params.getResult())
}