adds flag coalescing to argparser
adds handling of inlined args to call tools fixes terminal layout clearing troubles
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Cursor } from "./cursor.ts";
|
||||
import { ScrollManager } from "./scrollManager.ts";
|
||||
import { colorize } from "./style.ts";
|
||||
import { TerminalBlock, TerminalLayout } from "./TerminalLayout.ts";
|
||||
|
||||
@@ -11,11 +12,8 @@ export async function cliPrompt(
|
||||
|
||||
await Deno.stdin.setRaw(true);
|
||||
|
||||
let cursorVisible = true;
|
||||
if (!block) {
|
||||
cursorVisible = Cursor["visible"];
|
||||
Cursor.show();
|
||||
}
|
||||
const cursorVisible = Cursor["visible"];
|
||||
Cursor.show();
|
||||
|
||||
let range: [number, number] = [0, 1];
|
||||
if (block) {
|
||||
@@ -54,7 +52,7 @@ export async function cliPrompt(
|
||||
}
|
||||
|
||||
await Deno.stdin.setRaw(false);
|
||||
if (!block && !cursorVisible) {
|
||||
if (!cursorVisible) {
|
||||
Cursor.hide();
|
||||
}
|
||||
Deno.stdout.writeSync(encoder.encode("\n"));
|
||||
@@ -86,10 +84,12 @@ export function cliLog(message: string, block?: TerminalBlock) {
|
||||
}
|
||||
|
||||
if (import.meta.main) {
|
||||
Cursor.hide();
|
||||
const layout = new TerminalLayout();
|
||||
const title = new TerminalBlock();
|
||||
const block = new TerminalBlock();
|
||||
block.setPreserveHistory(true);
|
||||
// ScrollManager.enable(block);
|
||||
title.setLines(["Hello, World!"]);
|
||||
title.setFixedHeight(1);
|
||||
|
||||
@@ -105,6 +105,7 @@ if (import.meta.main) {
|
||||
cliLog(`Hello, ${name}!`, block);
|
||||
const single = await cliConfirm("Are you single?", block);
|
||||
cliLog(single ? "Do you want to go out with me?" : "Okay", block);
|
||||
// ScrollManager.enable(block);
|
||||
const loopingConvo = [
|
||||
"No response?",
|
||||
"I guess that's okay",
|
||||
|
Reference in New Issue
Block a user