Compare commits
2 Commits
628aef06e3
...
2e0bda7a6e
| Author | SHA1 | Date | |
|---|---|---|---|
|
2e0bda7a6e
|
|||
|
87c93f3ae0
|
@@ -4,7 +4,7 @@ import kernel.peripherals.Peripherals.Peripheral;
|
|||||||
import lib.CLIAppBase;
|
import lib.CLIAppBase;
|
||||||
|
|
||||||
@:build(macros.Binstore.includeBin("Peripheral", ["ph", "peripheral"]))
|
@:build(macros.Binstore.includeBin("Peripheral", ["ph", "peripheral"]))
|
||||||
class Perf extends CLIAppBase {
|
class Peri extends CLIAppBase {
|
||||||
public function new() {
|
public function new() {
|
||||||
registerSyncSubcommand("inspect", (args) -> {
|
registerSyncSubcommand("inspect", (args) -> {
|
||||||
var addr = args.getString("addr");
|
var addr = args.getString("addr");
|
||||||
@@ -12,28 +12,28 @@ using tink.CoreApi;
|
|||||||
class TurtleCtl extends CLIAppBase {
|
class TurtleCtl extends CLIAppBase {
|
||||||
public function new() {
|
public function new() {
|
||||||
registerAsyncSubcommand("f", (args) -> {
|
registerAsyncSubcommand("f", (args) -> {
|
||||||
return asynPerform(Turtle.forward, args.getInt("times"));
|
return asynPerform(Turtle.forward, args.getInt("times") ?? 1);
|
||||||
}, [Int("times")]);
|
}, [Optional(Int("times"))]);
|
||||||
|
|
||||||
registerAsyncSubcommand("b", (args) -> {
|
registerAsyncSubcommand("b", (args) -> {
|
||||||
return asynPerform(Turtle.back, args.getInt("times"));
|
return asynPerform(Turtle.back, args.getInt("times") ?? 1);
|
||||||
}, [Int("times")]);
|
}, [Optional(Int("times"))]);
|
||||||
|
|
||||||
registerAsyncSubcommand("l", (args) -> {
|
registerAsyncSubcommand("l", (args) -> {
|
||||||
return asynPerform(Turtle.turnLeft, args.getInt("times"));
|
return asynPerform(Turtle.turnLeft, args.getInt("times") ?? 1);
|
||||||
}, [Int("times")]);
|
}, [Optional(Int("times"))]);
|
||||||
|
|
||||||
registerAsyncSubcommand("r", (args) -> {
|
registerAsyncSubcommand("r", (args) -> {
|
||||||
return asynPerform(Turtle.turnRight, args.getInt("times"));
|
return asynPerform(Turtle.turnRight, args.getInt("times") ?? 1);
|
||||||
}, [Int("times")]);
|
}, [Optional(Int("times"))]);
|
||||||
|
|
||||||
registerAsyncSubcommand("u", (args) -> {
|
registerAsyncSubcommand("u", (args) -> {
|
||||||
return asynPerform(Turtle.up, args.getInt("times"));
|
return asynPerform(Turtle.up, args.getInt("times") ?? 1);
|
||||||
}, [Int("times")]);
|
}, [Optional(Int("times"))]);
|
||||||
|
|
||||||
registerAsyncSubcommand("d", (args) -> {
|
registerAsyncSubcommand("d", (args) -> {
|
||||||
return asynPerform(Turtle.down, args.getInt("times"));
|
return asynPerform(Turtle.down, args.getInt("times") ?? 1);
|
||||||
}, [Int("times")]);
|
}, [Optional(Int("times"))]);
|
||||||
|
|
||||||
registerAsyncSubcommand("defrag", (args) -> {
|
registerAsyncSubcommand("defrag", (args) -> {
|
||||||
return asynPerform(() -> {
|
return asynPerform(() -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user