Make echo and example available in new shell

This commit is contained in:
Ian Adam Naval 2015-02-26 18:07:50 -05:00
parent 7e708ba4ab
commit 7b5b8b4d06
3 changed files with 4 additions and 3 deletions

View File

@ -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):

View File

@ -30,4 +30,3 @@ class Echo(BaseCommand):
for line in input_generator:
yield line
return output_generator

View File

@ -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