File: 04-term_helper.lua

package info (click to toggle)
lua-system 0.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 656 kB
  • sloc: ansic: 1,500; makefile: 222
file content (13 lines) | stat: -rw-r--r-- 452 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
-- sub-script executed for isatty test
local writefile = require("pl.utils").writefile
local isatty = require("system").isatty
assert(arg[1] == "--", "missing -- argument")
local tempfile = assert(arg[2], "missing tempfile argument")

-- print("my temp file: ", tempfile)

assert(writefile(tempfile, [[{
  stdin = ]]..tostring(isatty(io.stdin))..[[,
  stdout = ]]..tostring(isatty(io.stdout))..[[,
  stderr = ]]..tostring(isatty(io.stderr))..[[,
}]]))