force lower character on command word

This commit is contained in:
chidea 2015-03-16 17:45:30 +09:00
parent 51c9fc4301
commit 186c5e837c

View File

@ -17,10 +17,11 @@ class telepyShell(cmd.Cmd):
intro='Welcome to telepy interactive shell. Type help or ? for help.\n'
prompt='>'
def precmd(self, line):
# if len(line) < 1 : return None
# lines = line.split()
# cmd_name = lines[0].lower()
return line
# convert first word(command name) to lower and return it as line
line = line.lstrip()
blank_pos = line.find(' ')
if blank_pos < 0: return line.lower()
return line[:blank_pos].lower() + ' ' + line[blank_pos+1:]
def completedefault(self, *ignored):
print(ignored)
def complete(self, text, state):