Add usage message for interactive terminal
This commit is contained in:
parent
4319229596
commit
996105f9cd
|
|
@ -1,9 +1,15 @@
|
||||||
#!/usr/bin/env bun
|
#!/usr/bin/env bun
|
||||||
|
|
||||||
|
import { isatty } from "node:tty"
|
||||||
import { renderMarkdown } from "./index"
|
import { renderMarkdown } from "./index"
|
||||||
|
|
||||||
const args = process.argv.slice(2)
|
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
|
let input: string
|
||||||
|
|
||||||
if (args.length > 0 && args[0] !== "-") {
|
if (args.length > 0 && args[0] !== "-") {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user