From 1d9e08641e2d78b37905fa1f238661657f5d53a2 Mon Sep 17 00:00:00 2001 From: Niklas Kapelle Date: Mon, 29 Jan 2024 01:25:15 +0100 Subject: [PATCH] added defrag to turtle command --- src/bin/Turtle.hx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/bin/Turtle.hx b/src/bin/Turtle.hx index 41056df..3370481 100644 --- a/src/bin/Turtle.hx +++ b/src/bin/Turtle.hx @@ -1,5 +1,6 @@ package bin; +import lib.turtle.InvManager; import lib.CLIAppBase; using tink.CoreApi; @@ -30,6 +31,15 @@ class Turtle extends CLIAppBase { registerSyncSubcommand("down", (args) -> { return checkAvailable() && perform(kernel.turtle.Turtle.down()); }); + + registerSyncSubcommand("defrag", (args) -> { + if (!checkAvailable()) { + return false; + } + + InvManager.defrag(); + return true; + }); } private function checkAvailable():Bool {