File: 04-term_helper.lua

package info (click to toggle)
lua-system 0.6.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 692 kB
  • sloc: ansic: 1,555; makefile: 222
file content (13 lines) | stat: -rw-r--r-- 452 bytes parent folder | download | duplicates (2)
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))..[[,
}]]))