add selfnames to version file
This commit is contained in:
@@ -15,13 +15,8 @@ import (
|
||||
"senan.xyz/g/gonic/version"
|
||||
)
|
||||
|
||||
const (
|
||||
programName = "gonic"
|
||||
programVar = "GONIC"
|
||||
)
|
||||
|
||||
func main() {
|
||||
set := flag.NewFlagSet(programName, flag.ExitOnError)
|
||||
set := flag.NewFlagSet(version.NAME, flag.ExitOnError)
|
||||
listenAddr := set.String("listen-addr", "0.0.0.0:4747", "listen address (optional)")
|
||||
musicPath := set.String("music-path", "", "path to music")
|
||||
dbPath := set.String("db-path", "gonic.db", "path to database (optional)")
|
||||
@@ -31,7 +26,7 @@ func main() {
|
||||
if err := ff.Parse(set, os.Args[1:],
|
||||
ff.WithConfigFileFlag("config-path"),
|
||||
ff.WithConfigFileParser(ff.PlainParser),
|
||||
ff.WithEnvVarPrefix(programVar),
|
||||
ff.WithEnvVarPrefix(version.NAME_UPPER),
|
||||
); err != nil {
|
||||
log.Fatalf("error parsing args: %v\n", err)
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import (
|
||||
|
||||
"github.com/peterbourgon/ff"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"senan.xyz/g/gonic/version"
|
||||
)
|
||||
|
||||
// once i had this written with ~100% text/template but it was very
|
||||
@@ -18,8 +20,7 @@ import (
|
||||
// but it's pretty fast. which i needed it to for live reloading stuff
|
||||
|
||||
const (
|
||||
programName = "gonicembed"
|
||||
byteCols = 24
|
||||
byteCols = 24
|
||||
|
||||
// begin file template
|
||||
fileHeader = `// file generated with embed tool
|
||||
@@ -122,7 +123,7 @@ func processAssets(c *config, files []string) error {
|
||||
}
|
||||
|
||||
func main() {
|
||||
set := flag.NewFlagSet(programName, flag.ExitOnError)
|
||||
set := flag.NewFlagSet(version.NAME_EMBED, flag.ExitOnError)
|
||||
outPath := set.String(
|
||||
"out-path", "",
|
||||
"generated file's path (required)")
|
||||
|
||||
@@ -10,15 +10,11 @@ import (
|
||||
|
||||
"senan.xyz/g/gonic/db"
|
||||
"senan.xyz/g/gonic/scanner"
|
||||
)
|
||||
|
||||
const (
|
||||
programName = "gonicscan"
|
||||
programVar = "GONIC"
|
||||
"senan.xyz/g/gonic/version"
|
||||
)
|
||||
|
||||
func main() {
|
||||
set := flag.NewFlagSet(programName, flag.ExitOnError)
|
||||
set := flag.NewFlagSet(version.NAME_SCAN, flag.ExitOnError)
|
||||
musicPath := set.String(
|
||||
"music-path", "",
|
||||
"path to music")
|
||||
@@ -26,7 +22,7 @@ func main() {
|
||||
"db-path", "gonic.db",
|
||||
"path to database (optional)")
|
||||
if err := ff.Parse(set, os.Args[1:],
|
||||
ff.WithEnvVarPrefix(programVar),
|
||||
ff.WithEnvVarPrefix(version.NAME_UPPER),
|
||||
); err != nil {
|
||||
log.Fatalf("error parsing args: %v\n", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user