]>
nmode's Git Repositories - signal-cli/blob - src/main/java/org/asamk/signal/commands/Commands.java
0f26c9945828a586a69c10a270d51bac909a90dd
1 package org
.asamk
.signal
.commands
;
3 import java
.util
.HashMap
;
5 import java
.util
.TreeMap
;
7 public class Commands
{
9 private static final Map
<String
, Command
> commands
= new HashMap
<>();
10 private static final Map
<String
, SubparserAttacher
> commandSubparserAttacher
= new TreeMap
<>();
13 addCommand(new AddDeviceCommand());
14 addCommand(new BlockCommand());
15 addCommand(new DaemonCommand());
16 addCommand(new DeleteLocalAccountDataCommand());
17 addCommand(new FinishChangeNumberCommand());
18 addCommand(new FinishLinkCommand());
19 addCommand(new GetAttachmentCommand());
20 addCommand(new GetUserStatusCommand());
21 addCommand(new AddStickerPackCommand());
22 addCommand(new JoinGroupCommand());
23 addCommand(new JsonRpcDispatcherCommand());
24 addCommand(new LinkCommand());
25 addCommand(new ListAccountsCommand());
26 addCommand(new ListContactsCommand());
27 addCommand(new ListDevicesCommand());
28 addCommand(new ListGroupsCommand());
29 addCommand(new ListIdentitiesCommand());
30 addCommand(new ListStickerPacksCommand());
31 addCommand(new QuitGroupCommand());
32 addCommand(new ReceiveCommand());
33 addCommand(new RegisterCommand());
34 addCommand(new RemoveContactCommand());
35 addCommand(new RemoveDeviceCommand());
36 addCommand(new RemovePinCommand());
37 addCommand(new RemoteDeleteCommand());
38 addCommand(new SendCommand());
39 addCommand(new SendContactsCommand());
40 addCommand(new SendPaymentNotificationCommand());
41 addCommand(new SendReactionCommand());
42 addCommand(new SendReceiptCommand());
43 addCommand(new SendSyncRequestCommand());
44 addCommand(new SendTypingCommand());
45 addCommand(new SetPinCommand());
46 addCommand(new SubmitRateLimitChallengeCommand());
47 addCommand(new StartChangeNumberCommand());
48 addCommand(new StartLinkCommand());
49 addCommand(new TrustCommand());
50 addCommand(new UnblockCommand());
51 addCommand(new UnregisterCommand());
52 addCommand(new UpdateAccountCommand());
53 addCommand(new UpdateConfigurationCommand());
54 addCommand(new UpdateContactCommand());
55 addCommand(new UpdateGroupCommand());
56 addCommand(new UpdateProfileCommand());
57 addCommand(new UploadStickerPackCommand());
58 addCommand(new VerifyCommand());
59 addCommand(new VersionCommand());
62 public static Map
<String
, SubparserAttacher
> getCommandSubparserAttachers() {
63 return commandSubparserAttacher
;
66 public static Command
getCommand(String commandKey
) {
67 if (!commands
.containsKey(commandKey
)) {
70 return commands
.get(commandKey
);
73 private static void addCommand(Command command
) {
74 commands
.put(command
.getName(), command
);
75 if (command
instanceof CliCommand cliCommand
) {
76 commandSubparserAttacher
.put(command
.getName(), cliCommand
::attachToSubparser
);