summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/KBCommandRegister.java
diff options
context:
space:
mode:
authorKeuin <[email protected]>2020-04-24 08:48:13 +0800
committerkeuin <[email protected]>2020-04-24 08:48:13 +0800
commit87f5cd97ab22b17a948eb9af1b49a0b1e777048d (patch)
tree26513b679f0f5327fed4f7233731430a40993aa6 /src/main/java/com/keuin/kbackupfabric/KBCommandRegister.java
parent8f3951090a8b1f385d1e2ab1319497c23fdeb3d8 (diff)
Added /kb delete <backup_name> for deleting an backup (with auto-complete supported).
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/KBCommandRegister.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/KBCommandRegister.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/KBCommandRegister.java b/src/main/java/com/keuin/kbackupfabric/KBCommandRegister.java
index 775dd62..4b4dd59 100644
--- a/src/main/java/com/keuin/kbackupfabric/KBCommandRegister.java
+++ b/src/main/java/com/keuin/kbackupfabric/KBCommandRegister.java
@@ -22,7 +22,10 @@ public final class KBCommandRegister {
dispatcher.register(CommandManager.literal("kb").then(CommandManager.literal("backup").then(CommandManager.argument("backupName", StringArgumentType.greedyString()).requires(PermissionValidator::op).executes(KBCommands::backup)).requires(PermissionValidator::op).executes(KBCommands::backupWithDefaultName)));
// register /kb restore <name> for performing restore. OP is required.
- dispatcher.register(CommandManager.literal("kb").then(CommandManager.literal("restore").then(CommandManager.argument("backupName", StringArgumentType.greedyString()).suggests(BackupNameSuggestionProvider.getSuggestionProvider()).requires(PermissionValidator::op).executes(KBCommands::restore)).executes(KBCommands::list)));
+ dispatcher.register(CommandManager.literal("kb").then(CommandManager.literal("restore").then(CommandManager.argument("backupName", StringArgumentType.greedyString()).suggests(BackupNameSuggestionProvider.getProvider()).requires(PermissionValidator::op).executes(KBCommands::restore)).executes(KBCommands::list)));
+
+ // register /kb delete [name] for deleting an existing backup. OP is required.
+ dispatcher.register(CommandManager.literal("kb").then(CommandManager.literal("delete").then(CommandManager.argument("backupName", StringArgumentType.greedyString()).suggests(BackupNameSuggestionProvider.getProvider()).requires(PermissionValidator::op).executes(KBCommands::delete))));
// register /kb confirm for confirming the execution. OP is required.
dispatcher.register(CommandManager.literal("kb").then(CommandManager.literal("confirm").requires(PermissionValidator::op).executes(KBCommands::confirm)));