Files
netmaker/cli/cmd/host/delete.go
Matthew R Kasun 823182cf09 add force flag to host/node delete (#2548)
* add force flag to host/node delete

* review comments

---------

Co-authored-by: Abhishek K <32607604+abhishek9686@users.noreply.github.com>
2023-09-13 10:10:17 +05:30

24 lines
528 B
Go

package host
import (
"github.com/gravitl/netmaker/cli/functions"
"github.com/spf13/cobra"
)
var force bool
var hostDeleteCmd = &cobra.Command{
Use: "delete HostID",
Args: cobra.ExactArgs(1),
Short: "Delete a host",
Long: `Delete a host`,
Run: func(cmd *cobra.Command, args []string) {
functions.PrettyPrint(functions.DeleteHost(args[0], force))
},
}
func init() {
rootCmd.AddCommand(hostDeleteCmd)
hostDeleteCmd.PersistentFlags().BoolVarP(&force, "force", "f", false, "delete even if part of network(s)")
}