update_networks.go 523 B

12345678910111213141516171819202122
  1. package host
  2. import (
  3. "strings"
  4. "github.com/gravitl/netmaker/cli/functions"
  5. "github.com/spf13/cobra"
  6. )
  7. var hostUpdateNetworksCmd = &cobra.Command{
  8. Use: "update_network HostID Networks(comma separated list)",
  9. Args: cobra.ExactArgs(2),
  10. Short: "Update a host's networks",
  11. Long: `Update a host's networks`,
  12. Run: func(cmd *cobra.Command, args []string) {
  13. functions.PrettyPrint(functions.UpdateHostNetworks(args[0], strings.Split(args[1], ",")))
  14. },
  15. }
  16. func init() {
  17. rootCmd.AddCommand(hostUpdateNetworksCmd)
  18. }