Merge pull request #6495 from thaJeztah/improve_versions

strip path-info from `-v` (version) output, and implement -v flag for containerd-shim
This commit is contained in:
Phil Estes
2022-03-08 13:57:34 -05:00
committed by GitHub
3 changed files with 26 additions and 9 deletions

View File

@@ -23,6 +23,7 @@ import (
"fmt"
"io"
"os"
"path/filepath"
"runtime"
"runtime/debug"
"strings"
@@ -240,7 +241,7 @@ func RunManager(ctx context.Context, manager Manager, opts ...BinaryOpts) {
func run(ctx context.Context, manager Manager, initFunc Init, name string, config Config) error {
parseFlags()
if versionFlag {
fmt.Printf("%s:\n", os.Args[0])
fmt.Printf("%s:\n", filepath.Base(os.Args[0]))
fmt.Println(" Version: ", version.Version)
fmt.Println(" Revision:", version.Revision)
fmt.Println(" Go version:", version.GoVersion)