diff --git a/spicetify.go b/spicetify.go index ab9eb82a1f..7008079665 100644 --- a/spicetify.go +++ b/spicetify.go @@ -52,8 +52,14 @@ func init() { log.SetOutput(colorable.NewColorableStdout()) // Separates flags and commands + parseFlags := true for _, v := range os.Args[1:] { - if len(v) > 0 && v[0] == '-' { + if parseFlags && v == "--" { + parseFlags = false + continue + } + + if parseFlags && len(v) > 0 && v[0] == '-' { if len(v) > 2 && v[1] != '-' { for _, char := range v[1:] { flags = append(flags, "-"+string(char)) @@ -494,6 +500,8 @@ upgrade|update Update spicetify to the latest version if an update is avail --bypass-admin Bypass admin or root (sudo) check. NOT RECOMMENDED +-- Stop parsing flags; treat remaining arguments as command values + -c, --config Print config file path and quit -h, --help Print this help text and quit @@ -532,6 +540,8 @@ replace_colors <0 | 1> spotify_launch_flags Command-line flags used when launching/restarting Spotify. Separate each flag with "|". + To set flags from the CLI, place "--" before the value. + Example: spicetify config spotify_launch_flags -- "--flag-1|--flag-2" List of valid flags: https://spicetify.app/docs/development/spotify-cli-flags always_enable_devtools <0 | 1> diff --git a/src/cmd/config.go b/src/cmd/config.go index b24cfade95..89fb554059 100644 --- a/src/cmd/config.go +++ b/src/cmd/config.go @@ -20,9 +20,7 @@ func EditConfig(args []string) { switch field { case "extensions", "custom_apps": arrayType(featureSection, field, value) - case "spotify_launch_flags": - // not editable via config command - case "prefs_path", "spotify_path", "current_theme", "color_scheme": + case "prefs_path", "spotify_path", "current_theme", "color_scheme", "spotify_launch_flags": stringType(settingSection, field, value) default: