delete.go 423 B

123456789101112131415161718192021
  1. package context
  2. import (
  3. "github.com/gravitl/netmaker/cli/config"
  4. "github.com/spf13/cobra"
  5. )
  6. // contextDeleteCmd deletes a contex
  7. var contextDeleteCmd = &cobra.Command{
  8. Use: "delete [NAME]",
  9. Args: cobra.ExactArgs(1),
  10. Short: "Delete a context",
  11. Long: `Delete a context`,
  12. Run: func(cmd *cobra.Command, args []string) {
  13. config.DeleteContext(args[0])
  14. },
  15. }
  16. func init() {
  17. rootCmd.AddCommand(contextDeleteCmd)
  18. }