mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-30 04:55:13 +00:00
refactor the cli codes which can be shared with shimv2. Signed-off-by: fupan <lifupan@gmail.com> Signed-off-by: Eric Ernst <eric.ernst@intel.com>
29 lines
521 B
Go
29 lines
521 B
Go
// Copyright (c) 2017 Intel Corporation
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
package main
|
|
|
|
import (
|
|
"github.com/kata-containers/runtime/pkg/katautils"
|
|
"github.com/urfave/cli"
|
|
)
|
|
|
|
var versionCLICommand = cli.Command{
|
|
Name: "version",
|
|
Usage: "display version details",
|
|
Action: func(context *cli.Context) error {
|
|
ctx, err := cliContextToContext(context)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
span, _ := katautils.Trace(ctx, "version")
|
|
defer span.Finish()
|
|
|
|
cli.VersionPrinter(context)
|
|
return nil
|
|
},
|
|
}
|