mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Refactor command creation
This commit is contained in:
parent
47143a90e1
commit
af292d8f0e
45 changed files with 436 additions and 282 deletions
|
@ -21,18 +21,23 @@ public class AddDeviceCommand implements JsonRpcLocalCommand {
|
|||
|
||||
private final static Logger logger = LoggerFactory.getLogger(AddDeviceCommand.class);
|
||||
|
||||
public static void attachToSubparser(final Subparser subparser) {
|
||||
@Override
|
||||
public String getName() {
|
||||
return "addDevice";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attachToSubparser(final Subparser subparser) {
|
||||
subparser.help("Link another device to this device. Only works, if this is the master device.");
|
||||
subparser.addArgument("--uri")
|
||||
.required(true)
|
||||
.help("Specify the uri contained in the QR code shown by the new device.");
|
||||
}
|
||||
|
||||
public AddDeviceCommand(final OutputWriter outputWriter) {
|
||||
}
|
||||
|
||||
@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 {
|
||||
m.addDeviceLink(new URI(ns.getString("uri")));
|
||||
} catch (IOException e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue