Files
nabarr/cmd/nabarr/version.go
l3uddz ce3807b819 initial code (#6)
* initial code commit
2021-02-14 16:18:26 +00:00

17 lines
367 B
Go

package main
import (
"fmt"
"github.com/alecthomas/kong"
)
type versionFlag string
func (v versionFlag) Decode(ctx *kong.DecodeContext) error { return nil }
func (v versionFlag) IsBool() bool { return true }
func (v versionFlag) BeforeApply(app *kong.Kong, vars kong.Vars) error {
fmt.Println(vars["version"])
app.Exit(0)
return nil
}