-S now means "seek to"

This commit is contained in:
Casey 2023-10-18 01:11:38 +03:00
parent b4d4d64c16
commit c713e0118d
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
1 changed files with 7 additions and 10 deletions

View File

@ -1,10 +1,10 @@
local args = { ... }
local shouldSeek = true
local seekTo = 0
local driveName = nil
if args[1] == "-S" then
shouldSeek = false
table.remove(args, 1)
seekTo = tonumber(table.remove(args, 1))
end
if args[1] == "-D" then
table.remove(args, 1)
@ -93,10 +93,9 @@ if length > tape.getSize() then
end
tape.stop()
if shouldSeek then
tape.seek(-tape.getSize())
tape.seek(seekTo)
tape.stop()
end
local _, y = term.getCursorPos()
local written = 0
@ -121,7 +120,5 @@ term.clearLine()
print("Written "..n_to_kib(written))
tape.stop()
if shouldSeek then
tape.seek(-tape.getSize())
tape.stop()
end