Skip to content

Commit

Permalink
feat(cmd): dynamic network list for command hint
Browse files Browse the repository at this point in the history
  • Loading branch information
distractedm1nd committed Sep 12, 2022
1 parent fad9ec5 commit a821b80
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/flags_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func NodeFlags() *flag.FlagSet {
flags.String(
nodeNetworkFlag,
"",
"The name of the network to connect to, e.g. arabica or mamaki",
"The name of the network to connect to, e.g. "+params.ListProvidedNetworks(),
)

return flags
Expand Down
8 changes: 8 additions & 0 deletions params/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,11 @@ var networksList = map[Network]struct{}{
Mamaki: {},
Private: {},
}

func ListProvidedNetworks() string {
var networks string
for net := range networksList {
networks += string(net) + ", "
}
return networks[:len(networks)-2]
}

0 comments on commit a821b80

Please sign in to comment.