allow passing in multiple presets

This commit is contained in:
filifa 2024-09-04 20:27:01 -05:00
parent 2b8eaeee49
commit 663accda2a
1 changed files with 3 additions and 9 deletions

View File

@ -25,7 +25,7 @@ import (
"github.com/veandco/go-sdl2/sdl" "github.com/veandco/go-sdl2/sdl"
) )
var preset string var presets []string
var scriptPath string var scriptPath string
var transition bool var transition bool
@ -43,12 +43,6 @@ func (s *script) load(path string) error {
} }
func getPresets() []string { func getPresets() []string {
var presets []string
if preset != "" {
presets = []string{preset}
}
if scriptPath != "" { if scriptPath != "" {
var s script var s script
s.load(scriptPath) s.load(scriptPath)
@ -170,8 +164,8 @@ func init() {
// when this action is called directly. // when this action is called directly.
rootCmd.Flags().BoolVarP(&transition, "transition", "t", false, "smoothly transition between presets") 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.Flags().StringVarP(&scriptPath, "script", "s", "", "script file to use")
rootCmd.MarkFlagsMutuallyExclusive("preset", "script") rootCmd.MarkFlagsMutuallyExclusive("presets", "script")
} }