]> nmode's Git Repositories - signal-cli/blob - src/main/java/org/asamk/signal/commands/Commands.java
Add --verbose flag to show extended logging
[signal-cli] / src / main / java / org / asamk / signal / commands / Commands.java
1 package org.asamk.signal.commands;
2
3 import java.util.HashMap;
4 import java.util.Map;
5
6 public class Commands {
7
8 private static final Map<String, Command> commands = new HashMap<>();
9
10 static {
11 addCommand("addDevice", new AddDeviceCommand());
12 addCommand("block", new BlockCommand());
13 addCommand("daemon", new DaemonCommand());
14 addCommand("getUserStatus", new GetUserStatusCommand());
15 addCommand("link", new LinkCommand());
16 addCommand("listContacts", new ListContactsCommand());
17 addCommand("listDevices", new ListDevicesCommand());
18 addCommand("listGroups", new ListGroupsCommand());
19 addCommand("listIdentities", new ListIdentitiesCommand());
20 addCommand("joinGroup", new JoinGroupCommand());
21 addCommand("quitGroup", new QuitGroupCommand());
22 addCommand("receive", new ReceiveCommand());
23 addCommand("register", new RegisterCommand());
24 addCommand("removeDevice", new RemoveDeviceCommand());
25 addCommand("removePin", new RemovePinCommand());
26 addCommand("send", new SendCommand());
27 addCommand("sendReaction", new SendReactionCommand());
28 addCommand("sendContacts", new SendContactsCommand());
29 addCommand("updateContact", new UpdateContactCommand());
30 addCommand("setPin", new SetPinCommand());
31 addCommand("trust", new TrustCommand());
32 addCommand("unblock", new UnblockCommand());
33 addCommand("unregister", new UnregisterCommand());
34 addCommand("updateAccount", new UpdateAccountCommand());
35 addCommand("updateGroup", new UpdateGroupCommand());
36 addCommand("updateProfile", new UpdateProfileCommand());
37 addCommand("verify", new VerifyCommand());
38 addCommand("uploadStickerPack", new UploadStickerPackCommand());
39 }
40
41 public static Map<String, Command> getCommands() {
42 return commands;
43 }
44
45 public static Command getCommand(String commandKey) {
46 if (!commands.containsKey(commandKey)) {
47 return null;
48 }
49 return commands.get(commandKey);
50 }
51
52 private static void addCommand(String name, Command command) {
53 commands.put(name, command);
54 }
55 }