mirror of
https://github.com/hanzoai/container.git
synced 2026-10-30 15:06:01 +00:00
* cli: accept profile name as arg for some commands * cli: remove obsolete --port-interface flag * vm: delegate port allocation to Lima * cli: add ssh-config * ssh-config: remove 'lima-' prefix from hostname
32 lines
708 B
Go
32 lines
708 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/abiosoft/colima/app"
|
|
"github.com/abiosoft/colima/cmd/root"
|
|
"github.com/abiosoft/colima/config"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
// versionCmd represents the version command
|
|
var versionCmd = &cobra.Command{
|
|
Use: "version [profile]",
|
|
Short: "print the version of Colima",
|
|
Long: `Print the version of Colima`,
|
|
Args: cobra.MaximumNArgs(1),
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
version := config.AppVersion()
|
|
fmt.Println(config.AppName, "version", version.Version)
|
|
fmt.Println("git commit:", version.Revision)
|
|
|
|
if colimaApp, err := app.New(); err == nil {
|
|
_ = colimaApp.Version()
|
|
}
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
root.Cmd().AddCommand(versionCmd)
|
|
}
|