wikingo/main.go

36 lines
606 B
Go
Raw Normal View History

2022-03-15 21:50:11 +01:00
package main
import (
2022-03-28 21:11:10 +02:00
"flag"
2022-03-15 21:50:11 +01:00
"fmt"
2022-03-28 21:19:36 +02:00
"os"
2022-03-28 21:11:10 +02:00
2022-03-15 21:50:11 +01:00
"github.com/oscarmlage/wikingo/server"
)
2022-03-28 21:19:36 +02:00
var (
app_name = "Wikingo"
app_version = "0.0.1"
)
2022-03-15 21:50:11 +01:00
func main() {
2022-03-28 21:11:10 +02:00
flag_debug := flag.Bool("d", false, "Enable debug mode")
2022-03-28 21:19:36 +02:00
flag_version := flag.Bool("v", false, "Show version")
2022-03-28 21:11:10 +02:00
flag.Parse()
2022-03-28 21:19:36 +02:00
// Version
if *flag_version {
fmt.Printf("%s - v%s\n", app_name, app_version)
os.Exit(0)
}
2022-03-28 21:11:10 +02:00
// Logger
server.InitLogger(*flag_debug)
server.Debug.Printf("Yo there")
2022-03-18 13:15:55 +01:00
2022-03-28 21:11:10 +02:00
fmt.Println("Starting wikingo...")
fmt.Printf("Debug mode: %t\n", *flag_debug)
2022-03-28 21:19:36 +02:00
fmt.Printf("Version: %t\n", *flag_version)
2022-03-15 21:50:11 +01:00
server.Serve()
}