Home

ugit @4731c0bd3502b9a7317f412c0ee3325a3b0ea457 - refs - log -
-
https://git.jolheiser.com/ugit.git
The code powering this h*ckin' site
ugit / cmd / ugitd / args.go
- raw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package main

import (
	"flag"

	"github.com/peterbourgon/ff/v3"
	"github.com/peterbourgon/ff/v3/ffyaml"
)

type args struct {
	db string
}

func parseArgs(args []string) (a args, e error) {
	fs := flag.NewFlagSet("ugitd", flag.ContinueOnError)
	fs.String("config", "ugit.yaml", "Path to config file")
	return a, ff.Parse(fs, args,
		ff.WithEnvVarPrefix("UGIT"),
		ff.WithConfigFileFlag("config"),
		ff.WithAllowMissingConfigFile(true),
		ff.WithConfigFileParser(ffyaml.Parser),
	)
}