mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 10:51:55 -04:00
Changed option flag for ls to display file and dir count to an unused one and made it read like dir in Windows (which is what it's meant to mimic, after all).
This commit is contained in:
parent
e7c863a00d
commit
a19c05442d
@ -30,7 +30,11 @@ for i = 1, #dirs do
|
||||
local lsf = {}
|
||||
for f in list do
|
||||
if f:sub(-1) == "/" then
|
||||
table.insert(lsd, f)
|
||||
if options.p then
|
||||
table.insert(lsd, f)
|
||||
else
|
||||
table.insert(lsd, f:sub(1, -2))
|
||||
end
|
||||
else
|
||||
table.insert(lsf, f)
|
||||
end
|
||||
@ -65,9 +69,9 @@ for i = 1, #dirs do
|
||||
end
|
||||
end
|
||||
setColor(0xFFFFFF)
|
||||
if options.c then
|
||||
io.write("\nDirectories: "..tostring(#lsd))
|
||||
io.write("\nFiles: "..tostring(#lsf))
|
||||
if options.M then
|
||||
io.write("\n" .. tostring(#lsf) .. " File(s)")
|
||||
io.write("\n" .. tostring(#lsd) .. " Dir(s)")
|
||||
end
|
||||
if not options.l then
|
||||
io.write("\n")
|
||||
@ -75,3 +79,4 @@ for i = 1, #dirs do
|
||||
end
|
||||
end
|
||||
io.output():setvbuf("no")
|
||||
io.output():flush()
|
@ -12,6 +12,10 @@ OPTIONS
|
||||
do not ignore entries starting with .
|
||||
-l
|
||||
use a long listing format
|
||||
-p
|
||||
append / indicator to directories
|
||||
-M
|
||||
display Microsoft-style file and directory count after listing
|
||||
|
||||
EXAMPLES
|
||||
ls
|
||||
|
@ -103,10 +103,10 @@ object LuaStateFactory {
|
||||
// If the file, already exists, make sure it's the same we need, if it's
|
||||
// not disable use of the natives.
|
||||
if (file.exists()) {
|
||||
var matching = true
|
||||
try {
|
||||
val inCurrent = libraryUrl.openStream()
|
||||
val inExisting = new FileInputStream(file)
|
||||
var matching = true
|
||||
var inCurrentByte = 0
|
||||
var inExistingByte = 0
|
||||
do {
|
||||
|
Loading…
x
Reference in New Issue
Block a user