Added ! as alias for /run #334

This commit is contained in:
Paul Gauthier 2024-01-22 13:52:59 -08:00
parent 96d60624cb
commit 4e3ace6199

View file

@ -26,8 +26,7 @@ class Commands:
self.tokenizer = coder.main_model.tokenizer self.tokenizer = coder.main_model.tokenizer
def is_command(self, inp): def is_command(self, inp):
if inp[0] == "/": return inp[0] in "/!"
return True
def get_commands(self): def get_commands(self):
commands = [] commands = []
@ -65,6 +64,10 @@ class Commands:
return matching_commands, first_word, rest_inp return matching_commands, first_word, rest_inp
def run(self, inp): def run(self, inp):
if inp.startswith("!"):
self.do_run("run", inp[1:])
return
res = self.matching_commands(inp) res = self.matching_commands(inp)
if res is None: if res is None:
return return