feat: recursively alias commands

pull/59/head
sammyette 2021-05-16 09:32:02 -04:00
parent 415e66ab9c
commit 0850247615
No known key found for this signature in database
GPG Key ID: 50EE40A2809851F5
1 changed files with 5 additions and 1 deletions

View File

@ -17,10 +17,14 @@ func RunInput(input string) {
cmdArgs, cmdString := splitInput(input)
// If alias was found, use command alias
if aliases[cmdArgs[0]] != "" {
for aliases[cmdArgs[0]] != "" {
alias := aliases[cmdArgs[0]]
cmdString = alias + strings.TrimPrefix(cmdString, cmdArgs[0])
cmdArgs, cmdString = splitInput(cmdString)
if aliases[cmdArgs[0]] != "" {
continue
}
}
// First try to load input, essentially compiling to bytecode