Skip to content

Commit 3c30a09

Browse files
committed
Fix ls hidden file handling.
1 parent fd26027 commit 3c30a09

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • implement-shell-tools/ls

implement-shell-tools/ls/ls.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222

2323
entries = os.listdir(args.filepath)
2424

25-
if not args.show_hidden_files:
25+
if args.show_hidden_files:
26+
entries = [".", ".."] + entries
27+
else:
2628
entries = [entry for entry in entries if not entry.startswith(".")]
2729

2830
if args.one_per_line:

0 commit comments

Comments
 (0)