-
Notifications
You must be signed in to change notification settings - Fork 0
add autocomplete #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
add small interface when scm is run directly without args
add function to be used in startup.lua (scm:cli(true))
scm.lua
Outdated
|
|
||
| local responseTable = textutils.unserializeJSON(response) | ||
| for i = 1, #responseTable, 1 do | ||
| if string.sub(responseTable[i]["name"], -string.len(self.config["programSuffix"])) == self.config["programSuffix"] then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats a mouthfull to read through
| for i = 1, #responseTable, 1 do | ||
| if string.sub(responseTable[i]["name"], -string.len(self.config["programSuffix"])) == self.config["programSuffix"] then | ||
| programs[string.sub(responseTable[i]["name"], 0, string.len(responseTable[i]["name"])-string.len(self.config["programSuffix"]))] = {} | ||
| elseif string.sub(responseTable[i]["name"], -string.len(self.config["librarySuffix"])) == self.config["librarySuffix"] then | ||
| libraries[string.sub(responseTable[i]["name"], 0, string.len(responseTable[i]["name"])-string.len(self.config["librarySuffix"]))] = {} | ||
| end | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| for i = 1, #responseTable, 1 do | |
| if string.sub(responseTable[i]["name"], -string.len(self.config["programSuffix"])) == self.config["programSuffix"] then | |
| programs[string.sub(responseTable[i]["name"], 0, string.len(responseTable[i]["name"])-string.len(self.config["programSuffix"]))] = {} | |
| elseif string.sub(responseTable[i]["name"], -string.len(self.config["librarySuffix"])) == self.config["librarySuffix"] then | |
| libraries[string.sub(responseTable[i]["name"], 0, string.len(responseTable[i]["name"])-string.len(self.config["librarySuffix"]))] = {} | |
| end | |
| end | |
| local progSuffix = self.config["programSuffix"] | |
| local libSuffix = self.config["librarySuffix"] | |
| local name | |
| for i = 1, #responseTable, 1 do | |
| name = responseTable[i]["name"] | |
| if string.sub(name, -string.len(progSuffix)) == progSuffix then | |
| programs[string.sub(name, 0, string.len(name)-string.len(progSuffix))] = {} | |
| elseif string.sub(name, -string.len(libSuffix)) == libSuffix then | |
| libraries[string.sub(responsname, 0, string.len(name)-string.len(libSuffix))] = {} | |
| end | |
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in newest commit
add autocomplete
scm remove all)scm update ...orscm remove ...)scm add ...orscm require ...)(this uses the github api, it will only download from github if a) it never has before or b) it has been refreshed manually)
scm refreshto update program and library names from github and refresh autocomplete in generalrefreshcommand)resolves #4