run.go: add license flag
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
f00b5bdaf8
commit
b5373602ba
16
run.go
16
run.go
@ -31,8 +31,7 @@ const (
|
||||
`
|
||||
slug = `Password Compromise Monitoring Tool
|
||||
https://git.dotya.ml/mirre-mt/pcmt
|
||||
____________________________________
|
||||
`
|
||||
____________________________________`
|
||||
|
||||
licenseHeader = `pcmt - Password Compromise Monitoring Tool
|
||||
Copyright (C) git.dotya.ml/wanderer
|
||||
@ -54,6 +53,7 @@ var (
|
||||
addr = flag.String("addr", ":3000", "TCP address:port to listen at")
|
||||
configFlag = flag.String("config", "config.dhall", "Default path of the config file")
|
||||
devel = flag.Bool("devel", false, "Run the application in dev mode, connect to a local browser-sync instance for hot-reloading")
|
||||
license = flag.Bool("license", false, "Print licensing information and exit")
|
||||
version = "dev"
|
||||
log *slogging.Logger
|
||||
|
||||
@ -61,10 +61,15 @@ var (
|
||||
)
|
||||
|
||||
func run() error {
|
||||
printHeader()
|
||||
|
||||
flag.Parse()
|
||||
|
||||
if *license {
|
||||
fmt.Fprintln(os.Stderr, licenseHeader)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
printHeader()
|
||||
|
||||
err := slogging.Init(true)
|
||||
if err != nil {
|
||||
return ErrCouldNotInitialiseLogger
|
||||
@ -164,8 +169,7 @@ func run() error {
|
||||
|
||||
func printHeader() {
|
||||
fmt.Fprintf(os.Stderr,
|
||||
"%s\n\n\033[34m%s%s\033[0m\n\n\n",
|
||||
licenseHeader,
|
||||
"\033[34m%s%s\033[0m\n\n\n",
|
||||
banner,
|
||||
slug,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user