Skip to content

Commit

Permalink
add NewListCommand function to fit CLI pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
h5law committed Jul 27, 2023
1 parent 66a1347 commit 870805f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app/client/cli/peer/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ import (
"github.com/pokt-network/pocket/shared/messaging"
)

var (
listCmd = &cobra.Command{
var ErrRouterType = fmt.Errorf("must specify one of --staked, --unstaked, or --all")

func init() {
PeerCmd.AddCommand(NewListCommand())
}

func NewListCommand() *cobra.Command {
return &cobra.Command{
Use: "List",
Short: "List the known peers",
Long: "Prints a table of the Peer ID, Pokt Address and Service URL of the known peers",
Aliases: []string{"list", "ls"},
RunE: listRunE,
}

ErrRouterType = fmt.Errorf("must specify one of --staked, --unstaked, or --all")
)

func init() {
PeerCmd.AddCommand(listCmd)
}

func listRunE(cmd *cobra.Command, _ []string) error {
Expand Down

0 comments on commit 870805f

Please sign in to comment.