mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Refactor command creation
This commit is contained in:
parent
47143a90e1
commit
af292d8f0e
45 changed files with 436 additions and 282 deletions
|
@ -15,10 +15,13 @@ import java.util.Locale;
|
|||
|
||||
public class TrustCommand implements JsonRpcLocalCommand {
|
||||
|
||||
public TrustCommand(final OutputWriter outputWriter) {
|
||||
@Override
|
||||
public String getName() {
|
||||
return "trust";
|
||||
}
|
||||
|
||||
public static void attachToSubparser(final Subparser subparser) {
|
||||
@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();
|
||||
|
@ -30,7 +33,9 @@ public class TrustCommand implements JsonRpcLocalCommand {
|
|||
}
|
||||
|
||||
@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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue