-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
Copyright (c) Yankee Maharjan 2022. All rights reserved. | ||
Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
*/ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
var Version = "development" | ||
|
||
var versionCmd = &cobra.Command{ | ||
Use: "version", | ||
Short: "Shows the application version", | ||
Long: `Show the applicaton version`, | ||
Example: "st version", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
fmt.Println("Version:", Version) | ||
}, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(versionCmd) | ||
} |