Go directly to a URL when passed on the command line. Closes #8

This commit is contained in:
Justin Overfelt 2019-05-08 20:16:59 -04:00
parent 9459c0c063
commit 4b547dc76a
1 changed files with 12 additions and 11 deletions

23
main.go
View File

@ -429,19 +429,20 @@ func main() {
}
mainWindow := screen.Windows[0]
firstLoad := true
if len(os.Args) > 1 {
err = goToURL(os.Args[1])
} else {
err = goHome()
}
if err != nil {
displayError(err)
} else {
updateMainContent()
}
for {
if firstLoad {
firstLoad = false
err := goHome()
if err == nil {
updateMainContent()
}
continue
}
c := cui.Getch()
switch c {
case 'j', 'J':