-S now means "seek to"
This commit is contained in:
parent
b4d4d64c16
commit
c713e0118d
17
tapeget.lua
17
tapeget.lua
|
@ -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.stop()
|
||||
end
|
||||
tape.seek(-tape.getSize())
|
||||
tape.seek(seekTo)
|
||||
tape.stop()
|
||||
|
||||
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
|
||||
tape.seek(-tape.getSize())
|
||||
tape.stop()
|
||||
|
|
Loading…
Reference in New Issue