This commit is contained in:
2025-05-15 00:46:57 +02:00
parent 30c71cb449
commit b2b27b2c3d
18 changed files with 622 additions and 234 deletions

View File

@@ -0,0 +1,38 @@
package version
import (
"cloudsave/pkg/constants"
"context"
"flag"
"fmt"
"runtime"
"strconv"
"github.com/google/subcommands"
)
type (
VersionCmd struct {
}
)
func (*VersionCmd) Name() string { return "version" }
func (*VersionCmd) Synopsis() string { return "show version and system information" }
func (*VersionCmd) Usage() string {
return `add:
Show version and system information
`
}
func (p *VersionCmd) SetFlags(f *flag.FlagSet) {
}
func (p *VersionCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus {
fmt.Println("Client: CloudSave cli")
fmt.Println(" Version: " + constants.Version)
fmt.Println(" API version: " + strconv.Itoa(constants.ApiVersion))
fmt.Println(" Go version: " + runtime.Version())
fmt.Println(" OS/Arch: " + runtime.GOOS + "/" + runtime.GOARCH)
return subcommands.ExitSuccess
}