autorestic/cmd/uninstall.go

21 lines
446 B
Go
Raw Normal View History

2021-04-12 10:55:57 +02:00
package cmd
import (
"github.com/cupcakearmy/autorestic/internal/bins"
"github.com/spf13/cobra"
)
var uninstallCmd = &cobra.Command{
Use: "uninstall",
Short: "Uninstall restic and autorestic",
Run: func(cmd *cobra.Command, args []string) {
2021-10-30 14:36:16 +02:00
restic, _ := cmd.Flags().GetBool("restic")
bins.Uninstall(restic)
2021-04-12 10:55:57 +02:00
},
}
func init() {
rootCmd.AddCommand(uninstallCmd)
2021-10-30 14:36:16 +02:00
uninstallCmd.Flags().Bool("restic", false, "also uninstall restic.")
2021-04-12 10:55:57 +02:00
}