fix: tryrun input from -c only if its provided

pull/59/head
sammyette 2021-05-16 08:42:20 -04:00
parent 83bcb35dcf
commit 83591f9bba
No known key found for this signature in database
GPG Key ID: 50EE40A2809851F5
1 changed files with 4 additions and 1 deletions

View File

@ -116,7 +116,10 @@ func main() {
readline.Completer = readline.FilenameCompleter readline.Completer = readline.FilenameCompleter
readline.LoadHistory(homedir + "/.hilbish-history") readline.LoadHistory(homedir + "/.hilbish-history")
RunInput(*cmdflag) if *cmdflag != "" {
RunInput(*cmdflag)
}
if getopt.NArgs() > 0 { if getopt.NArgs() > 0 {
l.SetGlobal("args", luar.New(l, getopt.Args())) l.SetGlobal("args", luar.New(l, getopt.Args()))
err := l.DoFile(getopt.Arg(0)) err := l.DoFile(getopt.Arg(0))