From 3d5a702a1a830314847ad3f13b121e7160bccbc9 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Fri, 2 May 2014 18:46:28 +0200 Subject: Adjust target command help message, print available targets --- src/main/TweetShell.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/TweetShell.java b/src/main/TweetShell.java index a7738d5..1f99999 100644 --- a/src/main/TweetShell.java +++ b/src/main/TweetShell.java @@ -172,10 +172,10 @@ public class TweetShell implements TwitterApi.PinSupplier { close("Close the stream"), exit("Returns to shell"), help("Get help"), - 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."); + target("Show available and enabled targets (if no args are given). " + + "If one or more args are given, change the output targets. " + + "A '-' or '+' prefix only enables/disables that target. " + + "With no prefix, all other targets get disabled."); private final String description; private final int paramCount; @@ -298,10 +298,13 @@ public class TweetShell implements TwitterApi.PinSupplier { } else { ClassEnabledTracker targets; targets = getPossibleTargets(); - // print the names of all targets that are enabled - System.out.print("Enabled targets:"); - for (String name : targets.getEnabled()) { + Set enabledTargets = targets.getEnabled(); + System.out.println("Possible targets (* = enabled):"); + for (String name : targets.getNames()) { System.out.print(" " + name); + if (enabledTargets.contains(name)) { + System.out.print("*"); + } } System.out.println(); } -- cgit v1.2.1