Skip to content

Commit

Permalink
Merge pull request AY2425S1-CS2103T-W12-3#164 from SlothyCat/improve-…
Browse files Browse the repository at this point in the history
…switch-success-message

Update Switch Command Success Message
  • Loading branch information
zienxu authored Nov 7, 2024
2 parents 9f35e80 + ae40f93 commit eb0d717
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
public class SwitchThemeCommand extends Command {
public static final String COMMAND_WORD = "switch";
public static final String MESSAGE_SUCCESS = "Changed Theme!";
public static final String MESSAGE_SUCCESS = "Changed Theme to %1$s!";
public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": Changes the theme of this interface.\n"
+ "Parameters: light or dark\n"
Expand All @@ -25,7 +25,8 @@ public SwitchThemeCommand(String theme) {
public CommandResult execute(Model model) {
requireNonNull(model);
ThemeController.switchTheme(theme);
return new CommandResult(MESSAGE_SUCCESS);
String themeMessage = theme.substring(0, 1).toUpperCase() + theme.substring(1).toLowerCase();
return new CommandResult(String.format(MESSAGE_SUCCESS, themeMessage));
}

@Override
Expand Down

0 comments on commit eb0d717

Please sign in to comment.