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

17
main.go
View File

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