1
0
mirror of https://github.com/makew0rld/amfora.git synced 2024-12-04 14:46:29 -05:00
amfora/amfora.go

46 lines
803 B
Go
Raw Normal View History

2020-06-18 16:54:48 -04:00
package main
import (
"fmt"
2020-06-18 16:54:48 -04:00
"os"
"github.com/makeworld-the-better-one/amfora/config"
"github.com/makeworld-the-better-one/amfora/display"
)
2020-06-24 13:52:44 -04:00
var version = "1.1.0"
2020-06-18 16:54:48 -04:00
func main() {
// err := logger.Init()
// if err != nil {
// panic(err)
// }
if len(os.Args) > 1 {
if os.Args[1] == "--version" || os.Args[1] == "-v" {
fmt.Print(version + "\r\n")
return
}
if os.Args[1] == "--help" || os.Args[1] == "-h" {
fmt.Print("Amfora is a fancy terminal browser for the Gemini protocol.\r\n\r\n")
fmt.Print("Usage:\r\namfora [URL]\r\namfora --version, -v\r\n")
return
}
}
2020-06-18 16:54:48 -04:00
err := config.Init()
if err != nil {
panic(err)
}
display.Init()
display.NewTab()
if len(os.Args[1:]) > 0 {
display.URL(os.Args[1])
2020-06-18 16:54:48 -04:00
}
if err = display.App.Run(); err != nil {
panic(err)
}
}