mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-06-20 20:26:03 +08:00
22 lines
481 B
Go
22 lines
481 B
Go
package shell
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/yunionio/onecloud/pkg/mcclient"
|
|
"github.com/yunionio/onecloud/pkg/mcclient/modules"
|
|
)
|
|
|
|
func init() {
|
|
type VersionOptions struct {
|
|
SERVICE string `help:"Service type"`
|
|
}
|
|
R(&VersionOptions{}, "version-show", "Show version of a backend service", func(s *mcclient.ClientSession, args *VersionOptions) error {
|
|
body, err := modules.GetVersion(s, args.SERVICE)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
fmt.Println(body)
|
|
return nil
|
|
})
|
|
}
|