From 3981512edbfbbef30619d1fb4f8af5b547898898 Mon Sep 17 00:00:00 2001 From: filifa Date: Wed, 4 Sep 2024 20:28:42 -0500 Subject: [PATCH] remove script flag --- cmd/root.go | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 4f94676..147231a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -17,7 +17,6 @@ along with this program. If not, see . package cmd import ( - "encoding/json" "log" "os" @@ -26,32 +25,8 @@ import ( ) var presets []string -var scriptPath string var transition bool -type script []string - -func (s *script) load(path string) error { - f, err := os.Open(path) - if err != nil { - return err - } - defer f.Close() - - err = json.NewDecoder(f).Decode(s) - return err -} - -func getPresets() []string { - if scriptPath != "" { - var s script - s.load(scriptPath) - presets = s - } - - return presets -} - func handleWindowEvent(event *sdl.WindowEvent, m *milkDropWindow) { switch event.Event { case sdl.WINDOWEVENT_RESIZED: @@ -98,7 +73,6 @@ func milkbucket(cmd *cobra.Command, args []string) { } defer sdl.Quit() - presets := getPresets() for _, p := range presets { info, err := os.Stat(p) if err != nil { @@ -165,7 +139,4 @@ func init() { rootCmd.Flags().BoolVarP(&transition, "transition", "t", false, "smoothly transition between presets") rootCmd.Flags().StringArrayVarP(&presets, "presets", "p", []string{}, "preset files to use") - rootCmd.Flags().StringVarP(&scriptPath, "script", "s", "", "script file to use") - - rootCmd.MarkFlagsMutuallyExclusive("presets", "script") }