working commit

This commit is contained in:
2026-06-09 22:33:18 +02:00
parent 56a73e87b6
commit f61b9b87e2
5 changed files with 106 additions and 50 deletions
-19
View File
@@ -2,8 +2,6 @@ package config
import (
"errors"
"flag"
"fmt"
"os"
"path/filepath"
@@ -102,23 +100,6 @@ func (conf *Config) ReadEnv() error {
func (conf *Config) ReadOpts() error {
var err error
exeName := filepath.Base(os.Args[0])
flag.BoolVar(&conf.AsDaemon, "asDaemon", conf.AsDaemon, "run as daemon")
flag.BoolVar(&conf.Debug, "debug", conf.Debug, "on debug mode")
help := func() {
fmt.Println("")
fmt.Printf("Usage: %s [option]\n", exeName)
fmt.Println("")
fmt.Println("Options:")
flag.PrintDefaults()
fmt.Println("")
}
flag.Usage = help
flag.Parse()
return err
}