File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -258,6 +258,7 @@ Additional run commands:
258258 rootCmd .AddCommand (NewPrintCmd (f , globalFlags ))
259259 rootCmd .AddCommand (NewRunPipelineCmd (f , globalFlags , rawConfig ))
260260 rootCmd .AddCommand (NewCompletionCmd ())
261+ rootCmd .AddCommand (NewVersionCmd ())
261262
262263 // check overwrite commands
263264 rootCmd .AddCommand (NewDevCmd (f , globalFlags , rawConfig ))
Original file line number Diff line number Diff line change 1+ package cmd
2+
3+ import (
4+ "fmt"
5+ "github.com/loft-sh/devspace/pkg/devspace/upgrade"
6+ "github.com/spf13/cobra"
7+ )
8+
9+ // NewVersionCmd returns the cobra command that outputs version
10+ func NewVersionCmd () * cobra.Command {
11+ return & cobra.Command {
12+ Use : "version" ,
13+ Args : cobra .NoArgs ,
14+ Short : "Prints version of devspace" ,
15+ Run : func (cobraCmd * cobra.Command , args []string ) {
16+ fmt .Println ("DevSpace version : " + upgrade .GetVersion ())
17+ },
18+ }
19+ }
You can’t perform that action at this time.
0 commit comments