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/logging"
|
||||||
"dwelling-radio/pkg/server"
|
"dwelling-radio/pkg/server"
|
||||||
"flag"
|
"flag"
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
@ -15,10 +16,16 @@ import (
|
|||||||
|
|
||||||
var configPath *string = flag.String("conf", "config.yaml", "path to configuration file")
|
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 logToStdout *bool = flag.Bool("log-stdout", false, "write logs to stdout")
|
||||||
|
var showVersion *bool = flag.Bool("v", false, "show version")
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
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)
|
config, err := configuration.LoadConfiguration(*configPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln(err)
|
log.Fatalln(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user