EditConfig changes one or multiple config value
(args []string)
| 12 | |
| 13 | // EditConfig changes one or multiple config value |
| 14 | func EditConfig(args []string) { |
| 15 | for len(args) >= 2 { |
| 16 | field := args[0] |
| 17 | value := args[1] |
| 18 | |
| 19 | switch field { |
| 20 | case "extensions", "custom_apps": |
| 21 | arrayType(featureSection, field, value) |
| 22 | case "spotify_launch_flags": |
| 23 | continue |
| 24 | case "prefs_path", "spotify_path", "current_theme", "color_scheme": |
| 25 | stringType(settingSection, field, value) |
| 26 | |
| 27 | default: |
| 28 | toggleType(field, value) |
| 29 | } |
| 30 | |
| 31 | args = args[2:] |
| 32 | } |
| 33 | |
| 34 | if err := cfg.Write(); err != nil { |
| 35 | utils.PrintWarning(fmt.Sprintf("Failed to save config: %s", err.Error())) |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | // DisplayAllConfig displays all configs in all sections |
| 40 | func DisplayAllConfig() { |
no test coverage detected