summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/ui/KBCommands.java
diff options
context:
space:
mode:
authorKeuin <[email protected]>2024-01-20 13:20:41 +0800
committerKeuin <[email protected]>2024-01-20 13:51:41 +0800
commit7e3cd92742383c43f2741449c551208e6487154e (patch)
treef6a4a51d0164231ac0fd2faed8f313aa504e2504 /src/main/java/com/keuin/kbackupfabric/ui/KBCommands.java
parent61aa66b558ae8f2987a238216ac01e375f195c1e (diff)
feature: configurable CoW incremental backup
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/ui/KBCommands.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/ui/KBCommands.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/ui/KBCommands.java b/src/main/java/com/keuin/kbackupfabric/ui/KBCommands.java
index d23a6fd..0dff99a 100644
--- a/src/main/java/com/keuin/kbackupfabric/ui/KBCommands.java
+++ b/src/main/java/com/keuin/kbackupfabric/ui/KBCommands.java
@@ -14,6 +14,7 @@ import com.keuin.kbackupfabric.operation.backup.method.ConfiguredIncrementalBack
import com.keuin.kbackupfabric.operation.backup.method.ConfiguredPrimitiveBackupMethod;
import com.keuin.kbackupfabric.util.DateUtil;
import com.keuin.kbackupfabric.util.PrintUtil;
+import com.keuin.kbackupfabric.util.cow.FileCowCopier;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.context.CommandContext;
import net.minecraft.server.MinecraftServer;
@@ -75,6 +76,7 @@ public final class KBCommands {
msgInfo(context, "/kb restore <backup_name> - Delete the whole current level and restore from given backup. /kb restore is identical with /kb list.");
msgInfo(context, "/kb confirm - Confirm and start restoring.");
msgInfo(context, "/kb cancel - Cancel the restoration to be confirmed. If cancelled, /kb confirm will not run.");
+ msgInfo(context, "/kb cow-info - Display copy-on-write support info (Experimental)");
return SUCCESS;
}
@@ -135,6 +137,15 @@ public final class KBCommands {
return SUCCESS;
}
+ public static int cowInfo(CommandContext<ServerCommandSource> context) {
+ try {
+ msgInfo(context, "KBackup-cow library version: " + FileCowCopier.getVersion());
+ } catch (Exception | UnsatisfiedLinkError ignored) {
+ msgErr(context, "KBackup-cow library is not loaded");
+ }
+ return SUCCESS;
+ }
+
/**
* Print backup information.
*