feat(upload): add first prototype of File storage, svg database and svg processing. Also added --help command
All checks were successful
build / Go-Build (push) Successful in 1m5s

This commit is contained in:
2026-02-03 00:29:08 +01:00
parent 5bd6f3b312
commit 9574c2d0bc
9 changed files with 258 additions and 37 deletions

View File

@@ -0,0 +1,37 @@
package command
import (
"flag"
"tomatentum.net/svg-templater/internal/server"
"tomatentum.net/svg-templater/pkg/svg"
)
var (
help bool
generateTokenFlag bool
deleteTokenFlag bool
datapath string
)
func PrepareCommandLine() {
flag.BoolVar(&help, "help", false, "Displays the help String")
flag.BoolVar(&generateTokenFlag, "tokengen", false, "Generate token with name")
flag.BoolVar(&deleteTokenFlag, "tokendel", false, "Delete token with name")
flag.StringVar(&datapath, "data", "/var/lib/svg-templater", "Override data directory")
}
func HandleCommandline() {
flag.Parse()
if generateTokenFlag {
GenerateTokenCommand()
} else if deleteTokenFlag {
DeleteTokenCommand()
} else if help {
flag.PrintDefaults()
} else {
svg.Storage = svg.NewFileStorage(datapath)
server.PrepareHTTP()
server.Start()
}
}