-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
39 lines (36 loc) · 880 Bytes
/
main.py
File metadata and controls
39 lines (36 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import Commands as cmd
import subprocess as sp #Use this later as it seems more complex but worth it
from matcher import wrongCmd
print("\n")
cmd.start()
a = str(input(cmd.current()))
while a!= "exit":
x = a.split(" ", 1)
if not x:
a = str(input(cmd.current()))
continue
elif x[0] == "cd": #works
cmd.cd(a)
elif x[0] == "ls": # works
cmd.ls()
elif x[0] == "run": #works?
cmd.run(a)
elif x[0] == "touch": #works
cmd.touch(a)
elif x[0] == "rm":
cmd.rm()
elif x[0] == "mkdir":
cmd.mkdir(a)
elif x[0] == "mv":
cmd.mv(a)
elif x[0] == "cp":
cmd.cp(a)
elif x[0] == "rmdir":
cmd.rmdir(a)
elif x[0] == "findext":
cmd.findext(a)
elif x[0] == "s":
cmd.search(x[1])
else:
wrongCmd(x[0])
a = str(input(cmd.current()))