Files
hash_utils/commands/version/version.go
2025-08-12 21:03:07 +02:00

35 lines
626 B
Go

package version
import (
"context"
"flag"
"fmt"
"runtime"
"github.com/google/subcommands"
)
const (
version string = "2.0.1"
)
type (
VersionCmd struct {
}
)
func (*VersionCmd) Name() string { return "version" }
func (*VersionCmd) Synopsis() string { return "" }
func (*VersionCmd) Usage() string {
return `Usage: hash_utils version
`
}
func (p *VersionCmd) SetFlags(f *flag.FlagSet) {
}
func (p *VersionCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus {
fmt.Printf("hash_utils %s %s/%s\n", version, runtime.GOOS, runtime.GOARCH)
return subcommands.ExitSuccess
}