Make ls
more POSIX-like
This commit is contained in:
parent
95011656f0
commit
844297a61e
11
bin/ls.py
11
bin/ls.py
|
@ -3,8 +3,17 @@ import os
|
||||||
def get_app_class(template):
|
def get_app_class(template):
|
||||||
class App(template):
|
class App(template):
|
||||||
def F_main(self):
|
def F_main(self):
|
||||||
for file in os.listdir(self.argv[1]):
|
if len(self.argv) == 1:
|
||||||
|
directory = "."
|
||||||
|
else:
|
||||||
|
directory = self.argv[1]
|
||||||
|
|
||||||
|
try:
|
||||||
|
for file in os.listdir(directory):
|
||||||
print(file)
|
print(file)
|
||||||
|
except OSError as e:
|
||||||
|
print(str(e))
|
||||||
|
|
||||||
self.exit()
|
self.exit()
|
||||||
|
|
||||||
return App
|
return App
|
||||||
|
|
Loading…
Reference in New Issue
Block a user