mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Check if output type is supported by command
This commit is contained in:
parent
c588130491
commit
a2debdb234
6 changed files with 37 additions and 0 deletions
|
@ -18,6 +18,7 @@ import org.slf4j.LoggerFactory;
|
|||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class DaemonCommand implements MultiLocalCommand {
|
||||
|
@ -37,6 +38,11 @@ public class DaemonCommand implements MultiLocalCommand {
|
|||
.action(Arguments.storeTrue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<OutputType> getSupportedOutputTypes() {
|
||||
return Set.of(OutputType.PLAIN_TEXT, OutputType.JSON);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int handleCommand(final Namespace ns, final Manager m) {
|
||||
boolean inJson = ns.get("output") == OutputType.JSON || ns.getBoolean("json");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue