mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-01 20:10:39 +00:00
Refactor command creation
This commit is contained in:
parent
47143a90e1
commit
af292d8f0e
45 changed files with 436 additions and 282 deletions
|
@ -13,10 +13,13 @@ import java.io.IOException;
|
|||
|
||||
public class UnregisterCommand implements LocalCommand {
|
||||
|
||||
public UnregisterCommand(final OutputWriter outputWriter) {
|
||||
@Override
|
||||
public String getName() {
|
||||
return "unregister";
|
||||
}
|
||||
|
||||
public static void attachToSubparser(final Subparser subparser) {
|
||||
@Override
|
||||
public void attachToSubparser(final Subparser subparser) {
|
||||
subparser.help("Unregister the current device from the signal server.");
|
||||
subparser.addArgument("--delete-account")
|
||||
.help("Delete account completely from server. CAUTION: Only do this if you won't use this number again!")
|
||||
|
@ -24,7 +27,9 @@ public class UnregisterCommand 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 {
|
||||
try {
|
||||
if (ns.getBoolean("delete-account")) {
|
||||
m.deleteAccount();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue