testing version of LuaBIOS and OpenOS
people were having issues getting them to work so now we promote consistency
This commit is contained in:
32
data/OpenOS/bin/yes.lua
Normal file
32
data/OpenOS/bin/yes.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
--[[Lua implementation of the UN*X yes command--]]
|
||||
local shell = require("shell")
|
||||
|
||||
local args, options = shell.parse(...)
|
||||
|
||||
if options.V or options.version then
|
||||
io.write("yes v:1.0-3\n")
|
||||
io.write("Inspired by functionality of yes from GNU coreutils\n")
|
||||
return 0
|
||||
end
|
||||
|
||||
if options.h or options.help then
|
||||
io.write("Usage: yes [string]...\n")
|
||||
io.write("OR: yes [-V/h]\n")
|
||||
io.write("\n")
|
||||
io.write("yes prints the command line arguments, or 'y', until is killed.\n")
|
||||
io.write("\n")
|
||||
io.write("Options:\n")
|
||||
io.write(" -V, --version Version\n")
|
||||
io.write(" -h, --help This help\n")
|
||||
return 0
|
||||
end
|
||||
|
||||
local msg = #args == 0 and 'y' or table.concat(args, ' ')
|
||||
msg = msg .. '\n'
|
||||
|
||||
while io.write(msg) do
|
||||
if io.stdout.tty then
|
||||
os.sleep(0)
|
||||
end
|
||||
end
|
||||
return 0
|
||||
Reference in New Issue
Block a user