X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/8e8eed7b061f1ed47cf9e30abb5e29ee08e3a3dc..b77d8206615d991ab31753fd15a8fa894335eb74:/src/main/java/org/asamk/signal/commands/TrustCommand.java diff --git a/src/main/java/org/asamk/signal/commands/TrustCommand.java b/src/main/java/org/asamk/signal/commands/TrustCommand.java index d6debf86..78f22c19 100644 --- a/src/main/java/org/asamk/signal/commands/TrustCommand.java +++ b/src/main/java/org/asamk/signal/commands/TrustCommand.java @@ -4,6 +4,7 @@ import net.sourceforge.argparse4j.impl.Arguments; import net.sourceforge.argparse4j.inf.Namespace; import net.sourceforge.argparse4j.inf.Subparser; +import org.asamk.signal.OutputWriter; import org.asamk.signal.commands.exceptions.CommandException; import org.asamk.signal.commands.exceptions.UserErrorException; import org.asamk.signal.manager.Manager; @@ -12,10 +13,16 @@ import org.whispersystems.signalservice.api.util.InvalidNumberException; import java.util.Locale; -public class TrustCommand implements LocalCommand { +public class TrustCommand implements JsonRpcLocalCommand { + + @Override + public String getName() { + return "trust"; + } @Override public void attachToSubparser(final Subparser subparser) { + subparser.help("Set the trust level of a given number."); subparser.addArgument("number").help("Specify the phone number, for which to set the trust.").required(true); var mutTrust = subparser.addMutuallyExclusiveGroup(); mutTrust.addArgument("-a", "--trust-all-known-keys") @@ -26,7 +33,9 @@ public class TrustCommand implements LocalCommand { } @Override - public void handleCommand(final Namespace ns, final Manager m) throws CommandException { + public void handleCommand( + final Namespace ns, final Manager m, final OutputWriter outputWriter + ) throws CommandException { var number = ns.getString("number"); if (ns.getBoolean("trust-all-known-keys")) { boolean res;