Skip to content

Commit

Permalink
Add version flag
Browse files Browse the repository at this point in the history
  • Loading branch information
yankeexe committed Aug 30, 2022
1 parent ef9d4e7 commit c477a04
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions cmd/version.go
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)
}

0 comments on commit c477a04

Please sign in to comment.