From 663accda2a3eb735c6692e62b84ea7125860d177 Mon Sep 17 00:00:00 2001 From: filifa Date: Wed, 4 Sep 2024 20:27:01 -0500 Subject: [PATCH] allow passing in multiple presets --- cmd/root.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index ecbb50c..4f94676 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -25,7 +25,7 @@ import ( "github.com/veandco/go-sdl2/sdl" ) -var preset string +var presets []string var scriptPath string var transition bool @@ -43,12 +43,6 @@ func (s *script) load(path string) error { } func getPresets() []string { - var presets []string - - if preset != "" { - presets = []string{preset} - } - if scriptPath != "" { var s script s.load(scriptPath) @@ -170,8 +164,8 @@ func init() { // when this action is called directly. rootCmd.Flags().BoolVarP(&transition, "transition", "t", false, "smoothly transition between presets") - rootCmd.Flags().StringVarP(&preset, "preset", "p", "", "preset file to use") + rootCmd.Flags().StringArrayVarP(&presets, "presets", "p", []string{}, "preset files to use") rootCmd.Flags().StringVarP(&scriptPath, "script", "s", "", "script file to use") - rootCmd.MarkFlagsMutuallyExclusive("preset", "script") + rootCmd.MarkFlagsMutuallyExclusive("presets", "script") }