delete.go 528 B

1234567891011121314151617181920212223
  1. package host
  2. import (
  3. "github.com/gravitl/netmaker/cli/functions"
  4. "github.com/spf13/cobra"
  5. )
  6. var force bool
  7. var hostDeleteCmd = &cobra.Command{
  8. Use: "delete HostID",
  9. Args: cobra.ExactArgs(1),
  10. Short: "Delete a host",
  11. Long: `Delete a host`,
  12. Run: func(cmd *cobra.Command, args []string) {
  13. functions.PrettyPrint(functions.DeleteHost(args[0], force))
  14. },
  15. }
  16. func init() {
  17. rootCmd.AddCommand(hostDeleteCmd)
  18. hostDeleteCmd.PersistentFlags().BoolVarP(&force, "force", "f", false, "delete even if part of network(s)")
  19. }