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 be70047 commit 00757b2Copy full SHA for 00757b2
1 file changed
implement-shell-tools/ls/ls.py
@@ -1,7 +1,7 @@
1
import os
2
import argparse
3
4
-parser=argparse.ArgumentParser(prog="cat",usage="implement a simple ls python")
+parser=argparse.ArgumentParser(prog="ls",usage="implement a simple ls python")
5
parser.add_argument("-1",dest="one",action="store_true")
6
parser.add_argument("-a",action="store_true")
7
parser.add_argument("path",nargs="*",help="path to list files")
@@ -27,10 +27,11 @@
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)
34
- elif args.one :
35
- if not item.startswith(".") :
+
+if args.one :
+ for item in files_list :
36
print(item)
+else:
+ print(" ".join(files_list))
37
0 commit comments