print help in rs command
This commit is contained in:
parent
af8241505f
commit
dabc42ea25
@ -13,6 +13,11 @@ class Redstone extends CLIApp {
|
||||
public function invoke(handle:TermHandle):Future<Bool> {
|
||||
var subcommand = handle.args[0];
|
||||
|
||||
if (subcommand == null) {
|
||||
handle.writeLn("Usage: redstone <on|off|get> <side>");
|
||||
return Future.sync(false);
|
||||
}
|
||||
|
||||
var side:Null<Side> = 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 <on|off|get> <side>");
|
||||
default:
|
||||
handle.writeLn("Invalid subcommand");
|
||||
return Future.sync(false);
|
||||
|
Loading…
Reference in New Issue
Block a user