From 3ce7986bbb8c3daf12cca4819dabbe28354e3708 Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Sun, 15 Nov 2015 14:13:08 +0100 Subject: Finished CLI tests, now need to fix some add bugs --- src/eu/equalparts/cardbase/cli/CardbaseCLI.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/eu/equalparts/cardbase') diff --git a/src/eu/equalparts/cardbase/cli/CardbaseCLI.java b/src/eu/equalparts/cardbase/cli/CardbaseCLI.java index 4db9473..b55b73d 100644 --- a/src/eu/equalparts/cardbase/cli/CardbaseCLI.java +++ b/src/eu/equalparts/cardbase/cli/CardbaseCLI.java @@ -162,7 +162,6 @@ public final class CardbaseCLI { */ private String[] sanitiseInput(String input) { return input.trim().split("[ \t]+"); - } /** @@ -415,8 +414,11 @@ public final class CardbaseCLI { if (selectedSet != null) { // a blank line after adding a card repeats the addition unlimitedly if (number.isEmpty()) { - if (lastAction == Action.ADD) + if (lastAction == Action.ADD) { addCard(lastAction.card); + } else { + System.out.println("Please enter a card number."); + } } else { Card cardToAdd = selectedSet.getCardByNumber(number); if (cardToAdd != null) { @@ -424,7 +426,7 @@ public final class CardbaseCLI { if (args != null && args.length > 0 && args[0].matches("[0-9]+")) { count = Integer.valueOf(args[0]); if (count <= 0) { - System.out.println("Can't add " + count + " cards."); + System.out.println("Cannot add " + count + " cards."); return; } } -- cgit v1.2.3