Skip to content

Commit

Permalink
Fix ls total in hidden and order
Browse files Browse the repository at this point in the history
  • Loading branch information
bill88t committed Jan 29, 2024
1 parent 751fa7e commit f1d24ef
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions LjinuxRoot/bin/ls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@
if "l" in vr("co"):
vr("sps", "\n")

if "a" in vr("co"):
term.write(colors.okcyan + "." + colors.endc, end=vr("sps"))
if not (vr("path") == "/" or (vr("path") == "./" and getcwd() == "/")):
term.write(colors.okcyan + ".." + colors.endc, end=vr("sps"))
vrd("path")

vr("cnt", len(vr("ls")))

if "a" not in vr("co"):
vr("ls2", [])
for pv[get_pid()]["i"] in range(vr("cnt")):
Expand All @@ -35,7 +28,7 @@
vr("cnt", len(vr("ls")))

if "l" in vr("co"):
term.write("total " + str(vr("cnt")))
term.write("total " + str(vr("cnt") + (2 if "a" in vr("co") else 0)))
vr(
"pmap",
{
Expand Down Expand Up @@ -67,6 +60,12 @@
},
)

if "a" in vr("co"):
term.write(colors.okcyan + "." + colors.endc, end=vr("sps"))
if not (vr("path") == "/" or (vr("path") == "./" and getcwd() == "/")):
term.write(colors.okcyan + ".." + colors.endc, end=vr("sps"))
vrd("path")

for pv[get_pid()]["i"] in range(vr("cnt")):
vr("col", "")
vr("fdat", vr("ls")[vr("i")])
Expand Down

0 comments on commit f1d24ef

Please sign in to comment.