We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ebe461 commit 152590cCopy full SHA for 152590c
implement-shell-tools/ls/ls.py
@@ -13,6 +13,21 @@
13
for path in paths :
14
files_list=os.listdir(path)
15
files_list.sort(key=str.lower)
16
+
17
+ # Divide into hidden and non-hidden
18
+ non_hidden = [f for f in files_list if not f.startswith(".")]
19
+ hidden = [f for f in files_list if f.startswith(".")]
20
21
+ # Sort each list
22
+ non_hidden.sort(key=str.lower)
23
+ hidden.sort(key=str.lower)
24
25
+ # Add '.' and '..' at the start if -a
26
+ if args.a:
27
+ files_list = ['.', '..'] + non_hidden + hidden
28
+ else:
29
+ files_list = non_hidden
30
31
for item in files_list :
32
if args.one and args.a :
33
print(item)
0 commit comments