cmd/searchix-web/version.go (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | package main import ( "fmt" "github.com/Southclaws/fault" "alin.ovh/searchix/internal/config" ) type Version struct{} func (*Version) Execute(_ []string) error { _, err := fmt.Printf("searchix %s\n", config.Version) if err != nil { return fault.Wrap(err) } return nil } func init() { var version Version _, err := parser.AddCommand("version", "print version", "print version", &version) if err != nil { panic(err) } } |