From dabc42ea2566f4ea2ea35f5f2ccf1b16c3be8a7c Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Sat, 4 Feb 2023 20:44:02 +0100 Subject: [PATCH] print help in rs command --- src/bin/Redstone.hx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/bin/Redstone.hx b/src/bin/Redstone.hx index e099eb5..8c620dc 100644 --- a/src/bin/Redstone.hx +++ b/src/bin/Redstone.hx @@ -13,6 +13,11 @@ class Redstone extends CLIApp { public function invoke(handle:TermHandle):Future { var subcommand = handle.args[0]; + if (subcommand == null) { + handle.writeLn("Usage: redstone "); + return Future.sync(false); + } + var side:Null = handle.args[1]; if (side == null) { handle.writeLn("Invalid side"); @@ -27,6 +32,8 @@ class Redstone extends CLIApp { case "get": var value = Peripheral.instance.getRedstone(side).getAnalogInput(); handle.writeLn("Analog input: " + value); + case "help": + handle.writeLn("Usage: redstone "); default: handle.writeLn("Invalid subcommand"); return Future.sync(false);