Add usage message for interactive terminal

This commit is contained in:
Chris Wanstrath 2026-03-30 09:13:51 -07:00
parent 4319229596
commit 996105f9cd

View File

@ -1,9 +1,15 @@
#!/usr/bin/env bun
import { isatty } from "node:tty"
import { renderMarkdown } from "./index"
const args = process.argv.slice(2)
if (args.length === 0 && isatty(0)) {
process.stderr.write(`Usage: tm <file>\n tm < file\n command | tm\n`)
process.exit(0)
}
let input: string
if (args.length > 0 && args[0] !== "-") {