Skip to content

Commit d9b7dd1

Browse files
author
Paul Sokolovsky
committed
upysh: Add "rm" and "rmdir" commands.
Also simplified "cd" implementation.
1 parent ceab4f3 commit d9b7dd1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

upysh/upysh.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ def __call__(self):
2828
pwd = PWD()
2929
ls = LS()
3030

31-
def cd(path):
32-
os.chdir(path)
33-
31+
cd = os.chdir
3432
mkdir = os.mkdir
3533
mv = os.rename
34+
rm = os.remove
35+
rmdir = os.rmdir
3636

3737
def head(f, n=10):
3838
with open(f) as f:
@@ -63,5 +63,5 @@ def help():
6363
6464
upysh commands:
6565
pwd, cd("new_dir"), ls, ls(...), head(...), cat(...)
66-
mkdir(...), newfile(...)
66+
newfile(...), rm(...), mkdir(...), rmdir(...)
6767
""")

0 commit comments

Comments
 (0)