Add `pigeon version` helper
This commit is contained in:
parent
123e58524d
commit
fb195f72e0
|
@ -1,7 +1,22 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"pigeon/pigeon"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
const x = pigeon.Version
|
||||
var versionCmd = &cobra.Command{
|
||||
Use: "version",
|
||||
Short: "Show the version of the Pigeon CLI tool.",
|
||||
Long: ``,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
result := fmt.Sprintf("Pigeon v%s", pigeon.Version)
|
||||
fmt.Println(result)
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(versionCmd)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue