1 package org
.asamk
.signal
.commands
;
3 import net
.sourceforge
.argparse4j
.impl
.Arguments
;
4 import net
.sourceforge
.argparse4j
.inf
.Namespace
;
5 import net
.sourceforge
.argparse4j
.inf
.Subparser
;
7 import org
.asamk
.signal
.OutputWriter
;
8 import org
.asamk
.signal
.commands
.exceptions
.CommandException
;
9 import org
.asamk
.signal
.commands
.exceptions
.IOErrorException
;
10 import org
.asamk
.signal
.manager
.Manager
;
12 import java
.io
.IOException
;
14 public class UnregisterCommand
implements LocalCommand
{
17 public String
getName() {
22 public void attachToSubparser(final Subparser subparser
) {
23 subparser
.help("Unregister the current device from the signal server.");
24 subparser
.addArgument("--delete-account")
25 .help("Delete account completely from server. CAUTION: Only do this if you won't use this number again!")
26 .action(Arguments
.storeTrue());
30 public void handleCommand(
31 final Namespace ns
, final Manager m
, final OutputWriter outputWriter
32 ) throws CommandException
{
34 if (ns
.getBoolean("delete-account")) {
39 } catch (IOException e
) {
40 throw new IOErrorException("Unregister error: " + e
.getMessage(), e
);