Find commands or aliases by prefix
(String prefix)
| 331 | * Find commands or aliases by prefix |
| 332 | */ |
| 333 | public static List<String> CompleteCommand(String prefix) { |
| 334 | List<String> cmds = new ArrayList<>(); |
| 335 | |
| 336 | for (cmd_function_t cmd : cmd_functions.values()) |
| 337 | if (cmd.name.startsWith(prefix)) |
| 338 | cmds.add(cmd.name); |
| 339 | |
| 340 | for (cmdalias_t a : cmd_alias.values()) |
| 341 | if (a.getName().startsWith(prefix)) |
| 342 | cmds.add(a.getName()); |
| 343 | |
| 344 | return cmds; |
| 345 | } |
| 346 | |
| 347 | public static void ExecuteFunction(String name, String... args) { |
| 348 | if (cmd_functions.containsKey(name)) { |
no test coverage detected