1 package org
.asamk
.signal
.commands
;
3 import net
.sourceforge
.argparse4j
.inf
.Namespace
;
4 import net
.sourceforge
.argparse4j
.inf
.Subparser
;
6 import org
.asamk
.signal
.OutputWriter
;
7 import org
.asamk
.signal
.commands
.exceptions
.CommandException
;
8 import org
.asamk
.signal
.commands
.exceptions
.IOErrorException
;
9 import org
.asamk
.signal
.manager
.Manager
;
11 import java
.io
.IOException
;
13 public class UpdateAccountCommand
implements JsonRpcLocalCommand
{
16 public String
getName() {
17 return "updateAccount";
21 public void attachToSubparser(final Subparser subparser
) {
22 subparser
.help("Update the account attributes on the signal server.");
23 subparser
.addArgument("-n", "--device-name").help("Specify a name to describe this device.");
27 public void handleCommand(
28 final Namespace ns
, final Manager m
, final OutputWriter outputWriter
29 ) throws CommandException
{
30 var deviceName
= ns
.getString("device-name");
32 m
.updateAccountAttributes(deviceName
);
33 } catch (IOException e
) {
34 throw new IOErrorException("UpdateAccount error: " + e
.getMessage(), e
);