autorestic/cmd/uninstall.go

21 lines
459 B
Go
Raw Normal View History

2021-04-12 08:55:57 +00: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) {
noRestic, _ := cmd.Flags().GetBool("no-restic")
bins.Uninstall(!noRestic)
},
}
func init() {
rootCmd.AddCommand(uninstallCmd)
2021-04-28 08:54:30 +00:00
uninstallCmd.Flags().Bool("no-restic", false, "do not uninstall restic.")
2021-04-12 08:55:57 +00:00
}