From 7e993235cb55801c8f314e541606ddd2011a4651 Mon Sep 17 00:00:00 2001 From: JaydenMW Date: Mon, 22 Feb 2021 03:48:26 +0000 Subject: [PATCH] Update shell.py --- shell.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/shell.py b/shell.py index e0a26db..18fbf51 100644 --- a/shell.py +++ b/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)