github.com/scaleway/scaleway-cli@v1.11.1/pkg/commands/version.go (about)

     1  // Copyright (C) 2015 Scaleway. All rights reserved.
     2  // Use of this source code is governed by a MIT-style
     3  // license that can be found in the LICENSE.md file.
     4  
     5  package commands
     6  
     7  import (
     8  	"fmt"
     9  	"runtime"
    10  
    11  	"github.com/scaleway/scaleway-cli/pkg/scwversion"
    12  )
    13  
    14  // VersionArgs are flags for the `RunVersion` function
    15  type VersionArgs struct{}
    16  
    17  // Version is the handler for 'scw version'
    18  func Version(ctx CommandContext, args VersionArgs) error {
    19  	fmt.Fprintf(ctx.Stdout, "Client version: %s\n", scwversion.VERSION)
    20  	fmt.Fprintf(ctx.Stdout, "Go version (client): %s\n", runtime.Version())
    21  	fmt.Fprintf(ctx.Stdout, "Git commit (client): %s\n", scwversion.GITCOMMIT)
    22  	fmt.Fprintf(ctx.Stdout, "OS/Arch (client): %s/%s\n", runtime.GOOS, runtime.GOARCH)
    23  	// FIXME: API version information
    24  
    25  	return nil
    26  }