()
| 142 | } |
| 143 | |
| 144 | func main() { |
| 145 | if slices.Contains(commands, "config-dir") { |
| 146 | cmd.ShowConfigDirectory() |
| 147 | return |
| 148 | } |
| 149 | |
| 150 | // Unchainable commands |
| 151 | switch commands[0] { |
| 152 | case "config": |
| 153 | commands = commands[1:] |
| 154 | if len(commands) == 0 { |
| 155 | cmd.DisplayAllConfig() |
| 156 | } else if len(commands) == 1 { |
| 157 | cmd.DisplayConfig(commands[0]) |
| 158 | } else { |
| 159 | cmd.EditConfig(commands) |
| 160 | } |
| 161 | return |
| 162 | |
| 163 | case "color": |
| 164 | commands = commands[1:] |
| 165 | if len(commands) == 0 { |
| 166 | cmd.DisplayColors() |
| 167 | } else { |
| 168 | cmd.EditColor(commands) |
| 169 | } |
| 170 | return |
| 171 | |
| 172 | case "spotify-updates": |
| 173 | cmd.InitPaths() |
| 174 | commands = commands[1:] |
| 175 | if len(commands) == 0 { |
| 176 | utils.PrintError("No parameter given. It has to be \"block\" or \"unblock\".") |
| 177 | return |
| 178 | } |
| 179 | param := commands[0] |
| 180 | switch param { |
| 181 | case "block": |
| 182 | cmd.BlockSpotifyUpdates(true) |
| 183 | case "unblock": |
| 184 | cmd.BlockSpotifyUpdates(false) |
| 185 | default: |
| 186 | utils.PrintError("Invalid parameter. It has to be \"block\" or \"unblock\".") |
| 187 | } |
| 188 | return |
| 189 | |
| 190 | case "path": |
| 191 | cmd.InitPaths() |
| 192 | commands = commands[1:] |
| 193 | path, err := (func() (string, error) { |
| 194 | if styleFocus { |
| 195 | if len(commands) == 0 { |
| 196 | return cmd.ThemeAllAssetsPath() |
| 197 | } |
| 198 | return cmd.ThemeAssetPath(commands[0]) |
| 199 | } else if extensionFocus { |
| 200 | if len(commands) == 0 { |
| 201 | return cmd.ExtensionAllPath() |
nothing calls this directly
no test coverage detected