mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-06 17:29:15 +08:00
23 lines
523 B
Go
23 lines
523 B
Go
package host
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/gravitl/netmaker/cli/functions"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var hostUpdateNetworksCmd = &cobra.Command{
|
|
Use: "update_network HostID Networks(comma separated list)",
|
|
Args: cobra.ExactArgs(2),
|
|
Short: "Update a host's networks",
|
|
Long: `Update a host's networks`,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
functions.PrettyPrint(functions.UpdateHostNetworks(args[0], strings.Split(args[1], ",")))
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(hostUpdateNetworksCmd)
|
|
}
|