diff --git a/psh/console.py b/psh/console.py index 06ffee7..cf649d7 100644 --- a/psh/console.py +++ b/psh/console.py @@ -5,7 +5,6 @@ import readline import shlex from psh.commands import registered_cmds -import psh.example_cmd DEFAULT_HISTORY_FILE = "~/.psh_history" @@ -26,7 +25,8 @@ def parse_cmd(potential_cmd): if cmd_name not in registered_cmds: return "RawCommand({})".format(shlex.split(potential_cmd)) else: - return "{0}({1})".format(cmd_name,str(args)) + cls = registered_cmds[cmd_name].__name__ + return "{0}({1})".format(cls, str(args)) def parse_cmds(raw_input_line): diff --git a/psh/example_cmd.py b/psh/example_cmd.py index 897dda7..e54e408 100644 --- a/psh/example_cmd.py +++ b/psh/example_cmd.py @@ -30,4 +30,3 @@ class Echo(BaseCommand): for line in input_generator: yield line return output_generator - diff --git a/psh/run.py b/psh/run.py index 2118e04..a8b79a7 100644 --- a/psh/run.py +++ b/psh/run.py @@ -2,6 +2,8 @@ import os import os.path from psh.formatters import * + +from psh.example_cmd import Echo, Example from psh.raw_commands import RawCommand # Load all of the commands in the path into the global namespace as raw