mirror of
https://github.com/jc21/nginx-proxy-manager.git
synced 2024-08-30 18:22:48 +00:00
29 lines
477 B
Go
29 lines
477 B
Go
package config
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/alexflint/go-arg"
|
|
)
|
|
|
|
// ArgConfig is the settings for passing arguments to the command
|
|
type ArgConfig struct {
|
|
Version bool `arg:"-v" help:"print version and exit"`
|
|
}
|
|
|
|
var (
|
|
appArguments ArgConfig
|
|
)
|
|
|
|
// InitArgs will parse arg vars
|
|
func InitArgs(version, commit *string) {
|
|
// nolint: errcheck, gosec
|
|
arg.MustParse(&appArguments)
|
|
|
|
if appArguments.Version {
|
|
fmt.Printf("v%s (%s)\n", *version, *commit)
|
|
os.Exit(0)
|
|
}
|
|
}
|