add 'source' command to read a configuration file

Related #97
This commit is contained in:
Gokcehan committed 2018-06-28 17:14:35 +03:00
1 parent 5d5d00e30b
commit 6c319316e2
4 files changed
+9

No files matched your search

+6
View File
@@ -464,6 +464,12 @@ func (e *callExpr) eval(app *app, args []string) {
}
app.ui.loadFile(app.nav)
app.ui.loadFileInfo(app.nav)
case "source":
if len(e.args) != 1 {
app.ui.print("source: requires an argument")
return
}
app.readFile(strings.Replace(e.args[0], "~", gUser.HomeDir, -1))
case "push":
if len(e.args) != 1 {
app.ui.print("push: requires an argument")