Files
Abiola IbrahimandGitHub 67099d323a cli: ux improvements (#207)
* 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
2022-03-07 07:07:39 +01:00

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)
}