summaryrefslogtreecommitdiff
path: root/src/main/TweetShell.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/TweetShell.java')
-rw-r--r--src/main/TweetShell.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/TweetShell.java b/src/main/TweetShell.java
index a0cfec6..1d03efb 100644
--- a/src/main/TweetShell.java
+++ b/src/main/TweetShell.java
@@ -253,7 +253,18 @@ public class TweetShell implements TwitterApi.PinSupplier {
}
break;
case commit:
- getStream().commit();
+ if (getStream().getKeywords(false).isEmpty()) {
+ if (getStream().getKeywords(true).isEmpty()) {
+ System.err.println("Add at least one keyword with 'add'");
+ } else {
+ System.err.println("No keywords are available, the "
+ + "stream will stay open. Stop streaming with "
+ + "the 'close' command or add new keywords "
+ + "with 'add'.");
+ }
+ } else {
+ getStream().commit();
+ }
break;
case status:
TweetCounter tc;