Skip to content

Commit 8cf36a6

Browse files
committed
review fix
1 parent 8aa41d6 commit 8cf36a6

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

  • implement-shell-tools/ls

implement-shell-tools/ls/ls.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ def main():
2020
path = item
2121
scanResult = os.scandir(path)
2222
isHiddenToShow = "-a" in flags
23-
isStatsToList = "-1" in flags
23+
isShowLineByLine = "-1" in flags
24+
isStatsToList = "-l" in flags
2425
content = sortDirContent(scanResult, isHiddenToShow)
2526

26-
if not isHiddenToShow and not isStatsToList:
27+
if not isHiddenToShow and not isStatsToList and not isShowLineByLine:
2728
output = ""
2829
for item in content:
2930
output += (
@@ -32,6 +33,13 @@ def main():
3233
else item.name + " "
3334
)
3435
print(output)
36+
if not isHiddenToShow and not isStatsToList and isShowLineByLine:
37+
for item in content:
38+
print(
39+
addColorToStr("\033[34m", item.name) + " "
40+
if Path(item).is_dir()
41+
else item.name + " "
42+
)
3543
elif isHiddenToShow and not isStatsToList:
3644
output = (
3745
addColorToStr("\033[34m", currentDir)

0 commit comments

Comments
 (0)