Files
accounting/cmd/invoicer/main.go
schreifuchs 7d160d5f59
All checks were successful
Go / build (push) Successful in 57s
feat: reastructure and create commands
2025-09-16 21:14:39 +02:00

38 lines
420 B
Go

package main
import (
"flag"
"log"
"os"
"github.com/itzg/go-flagsfiller"
)
func main() {
if len(os.Args) < 2 {
return
}
var cmd *cmd
for n, c := range commands {
if os.Args[1] == n {
cmd = &c
break
}
}
if cmd == nil {
return
}
if cmd.config != nil {
filler := flagsfiller.New()
err := filler.Fill(flag.CommandLine, cmd.config)
if err != nil {
log.Fatal(err)
}
}
cmd.Run()
}