diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-05-02 13:28:25 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-05-02 13:28:25 +0200 |
commit | db80ae2107b658923ef894adb3679ea2fe4cab63 (patch) | |
tree | 29979f44fca371e134d5a46508e345f2a62e2d12 | |
parent | 150539368127e61af9d076bd30e3f49d13db4430 (diff) | |
download | TwitterDataAnalytics-db80ae2107b658923ef894adb3679ea2fe4cab63.tar.gz |
Fix enabled targets print, allow multiple args, improve help
-rw-r--r-- | src/main/TweetShell.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/TweetShell.java b/src/main/TweetShell.java index 6d9edd1..12814b0 100644 --- a/src/main/TweetShell.java +++ b/src/main/TweetShell.java @@ -171,9 +171,10 @@ public class TweetShell implements TwitterApi.PinSupplier { close("Close the stream"), exit("Returns to shell"), help("Get help"), - target("Set output target: one or more of {file, shell} with optional." - + "'-' (disable) or '+' (enable) prefix. Without prefix, " - + "only that target is enabled."); + target("Show output target (no args) or set output target: one or more " + + "of {file, shell}. With a '-' or '+' prefix, that target " + + "is removed/added from the list of targets. Without prefix, " + + "all other targets get disabled."); private final String description; private final int paramCount; @@ -276,13 +277,18 @@ public class TweetShell implements TwitterApi.PinSupplier { throw new NoSuchElementException(); case target: if (params.length > 0) { + // due to limitations of shell (does not handle escapes), + // do a manualy split as we cannot have spaces in our args. + if (params.length == 1) { + params = params[0].split("\\s+"); + } configureTargets(params); } else { ClassEnabledTracker<ResultListener> targets; targets = getPossibleTargets(); // print the names of all targets that are enabled System.out.print("Enabled targets:"); - for (String name : targets.getNames()) { + for (String name : targets.getEnabled()) { System.out.print(" " + name); } System.out.println(); |