parent
ce85d8b717
commit
1e4ecef4ce
|
@ -9,6 +9,7 @@ import (
|
|||
"log"
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
"text/tabwriter"
|
||||
"time"
|
||||
)
|
||||
|
@ -18,10 +19,12 @@ import (
|
|||
|
||||
var (
|
||||
showDetails bool
|
||||
only []string
|
||||
)
|
||||
|
||||
func init() {
|
||||
AdminClientListNodes.Flags().BoolVar(&showDetails, "showDetails", false, "Show error counter and contract addresses")
|
||||
AdminClientListNodes.Flags().StringSliceVar(&only, "only", nil, "Show only networks with the given name")
|
||||
}
|
||||
|
||||
var AdminClientListNodes = &cobra.Command{
|
||||
|
@ -104,6 +107,18 @@ func runListNodes(cmd *cobra.Command, args []string) {
|
|||
networks = append(networks, network{"Ropsten", vaa.ChainIDEthereumRopsten})
|
||||
}
|
||||
|
||||
if len(only) > 0 {
|
||||
var filtered []network
|
||||
for _, network := range networks {
|
||||
for _, name := range only {
|
||||
if strings.ToLower(name) == strings.ToLower(network.string) {
|
||||
filtered = append(filtered, network)
|
||||
}
|
||||
}
|
||||
}
|
||||
networks = filtered
|
||||
}
|
||||
|
||||
for _, k := range networks {
|
||||
headers = append(headers, k.string)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue