Let's add -v flag that will show current version.
This commit is contained in:
parent
1dad2ffa5f
commit
032fde9648
@ -7,6 +7,7 @@ import (
|
||||
"dwelling-radio/pkg/logging"
|
||||
"dwelling-radio/pkg/server"
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
@ -15,10 +16,16 @@ import (
|
||||
|
||||
var configPath *string = flag.String("conf", "config.yaml", "path to configuration file")
|
||||
var logToStdout *bool = flag.Bool("log-stdout", false, "write logs to stdout")
|
||||
var showVersion *bool = flag.Bool("v", false, "show version")
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
if *showVersion {
|
||||
fmt.Println("dwelling-radio Ver. 22.13.0\nCopyright (c) 2022 Alexander \"Arav\" Andreev <me@arav.top>")
|
||||
return
|
||||
}
|
||||
|
||||
config, err := configuration.LoadConfiguration(*configPath)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
|
Loading…
Reference in New Issue
Block a user