aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEduardo Pedroni <e.pedroni91@gmail.com>2015-11-15 14:13:08 +0100
committerEduardo Pedroni <e.pedroni91@gmail.com>2015-11-15 14:13:08 +0100
commit3ce7986bbb8c3daf12cca4819dabbe28354e3708 (patch)
tree925bdbd65e8453f55cb8614cf405813c52f8e4af /src
parent2d4a5a5e8807ac2265683013757693f6b91fcbcb (diff)
Finished CLI tests, now need to fix some add bugs
Diffstat (limited to 'src')
-rw-r--r--src/eu/equalparts/cardbase/cli/CardbaseCLI.java8
1 files changed, 5 insertions, 3 deletions
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;
}
}