]> nmode's Git Repositories - signal-cli/blob - src/main/java/org/asamk/signal/commands/Commands.java
Improve command line help
[signal-cli] / src / main / java / org / asamk / signal / commands / Commands.java
1 package org.asamk.signal.commands;
2
3 import java.util.Map;
4 import java.util.TreeMap;
5
6 public class Commands {
7
8 private static final Map<String, Command> commands = new TreeMap<>();
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("remoteDelete", new RemoteDeleteCommand());
26 addCommand("removePin", new RemovePinCommand());
27 addCommand("send", new SendCommand());
28 addCommand("sendContacts", new SendContactsCommand());
29 addCommand("sendReaction", new SendReactionCommand());
30 addCommand("sendSyncRequest", new SendSyncRequestCommand());
31 addCommand("setPin", new SetPinCommand());
32 addCommand("trust", new TrustCommand());
33 addCommand("unblock", new UnblockCommand());
34 addCommand("unregister", new UnregisterCommand());
35 addCommand("updateAccount", new UpdateAccountCommand());
36 addCommand("updateContact", new UpdateContactCommand());
37 addCommand("updateGroup", new UpdateGroupCommand());
38 addCommand("updateProfile", new UpdateProfileCommand());
39 addCommand("uploadStickerPack", new UploadStickerPackCommand());
40 addCommand("verify", new VerifyCommand());
41 }
42
43 public static Map<String, Command> getCommands() {
44 return commands;
45 }
46
47 public static Command getCommand(String commandKey) {
48 if (!commands.containsKey(commandKey)) {
49 return null;
50 }
51 return commands.get(commandKey);
52 }
53
54 private static void addCommand(String name, Command command) {
55 commands.put(name, command);
56 }
57 }