From 4b547dc76adb88ba2f7b90b77c9c053dede56f22 Mon Sep 17 00:00:00 2001 From: Justin Overfelt Date: Wed, 8 May 2019 20:16:59 -0400 Subject: [PATCH] Go directly to a URL when passed on the command line. Closes #8 --- main.go | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/main.go b/main.go index 564e759..e6b6074 100644 --- a/main.go +++ b/main.go @@ -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':