all repos — todo.txt-web @ 36df3237dfb386e6610e4ff56381edd5023099fd

Minimalist Web interface for todo.txt file management

🔧 Provide config path using flag
Tim Izzo tim@5ika.ch
Sun, 20 Jul 2025 15:11:59 +0200
commit

36df3237dfb386e6610e4ff56381edd5023099fd

parent

a795cba0c655a10601ab9ab5a44bb76e0b82108a

1 files changed, 5 insertions(+), 1 deletions(-)

jump to
M config.goconfig.go

@@ -3,6 +3,7 @@

import ( "crypto/tls" "crypto/x509" + "flag" "os" "github.com/charmbracelet/log"

@@ -22,7 +23,10 @@ TodoPath string `yaml:"todoPath"`

} func getConfig() Config { - configFile, err := os.ReadFile("./config.yaml") + configPath := flag.String("config", "config.yaml", "Path to config file") + flag.Parse() + + configFile, err := os.ReadFile(*configPath) if err != nil { log.Fatalf("Can't read config file: %s", err) }