Update shell.py
This commit is contained in:
parent
745b35879b
commit
7e993235cb
32
shell.py
32
shell.py
|
@ -8,7 +8,7 @@ RAM = psutil.virtual_memory()
|
|||
CPU = platform.processor()
|
||||
OS = os_name = platform.system()
|
||||
|
||||
VER = "PCLISH v0.0.5a"
|
||||
VER = "PCLISH v0.0.5a-patch2a"
|
||||
|
||||
PROMPT = "shell@localhost$ "
|
||||
|
||||
|
@ -54,14 +54,13 @@ def pclish_cd(path):
|
|||
except Exception:
|
||||
print("cd: no such file or directory: {}".format(path))
|
||||
|
||||
def pclish_echo(txt):
|
||||
try:
|
||||
print((txt))
|
||||
except Exception:
|
||||
print("You need to provide arguments for this command. {}".format(path))
|
||||
def pclish_echo():
|
||||
TXT = input("ARGS: ")
|
||||
print(TXT)
|
||||
|
||||
def pclish_oscmd(ARGS):
|
||||
os.system(ARGS)
|
||||
def pclish_oscmd():
|
||||
CMD = input("ARGS: ")
|
||||
os.system(CMD)
|
||||
|
||||
def pclish_help():
|
||||
print("""pclish: here are the commands available
|
||||
|
@ -80,7 +79,8 @@ def pclish_ls():
|
|||
def pclish_ver():
|
||||
print(VER)
|
||||
|
||||
def pclish_mkdir(DIR):
|
||||
def pclish_mkdir():
|
||||
DIR = input("ARGS: ")
|
||||
os.mkdir(DIR)
|
||||
|
||||
def pclish_system():
|
||||
|
@ -104,24 +104,24 @@ def main():
|
|||
inp = input(PROMPT)
|
||||
if inp == "exit":
|
||||
break
|
||||
elif inp[:3] == "cd ":
|
||||
elif inp[] == "cd ":
|
||||
pclish_cd(inp[3:])
|
||||
elif inp == "help":
|
||||
pclish_help()
|
||||
elif inp == "ver":
|
||||
pclish_ver()
|
||||
elif inp == "ls ":
|
||||
pclish_ls(inp[3:])
|
||||
elif inp[:3] == "mkdir ":
|
||||
pclish_mkdir(inp[3:])
|
||||
elif inp == "ls":
|
||||
pclish_ls()
|
||||
elif inp[] == "mkdir":
|
||||
pclish_mkdir()
|
||||
elif inp == "shtdwnsubsys":
|
||||
pclish_shtdwnsubsys()
|
||||
elif inp == "system":
|
||||
pclish_system()
|
||||
elif inp[:3] == "echo ":
|
||||
pclish_echo(inp[3:])
|
||||
pclish_echo()
|
||||
elif inp[:3] == "oscmd ":
|
||||
pclish_oscmd(inp[3:])
|
||||
pclish_oscmd()
|
||||
else:
|
||||
execute_command(inp)
|
||||
|
||||
|
|
Loading…
Reference in New Issue