Add `pigeon version` helper

This commit is contained in:
Netscape Navigator 2020-08-02 14:10:32 -05:00
parent 123e58524d
commit fb195f72e0
2 changed files with 16 additions and 1 deletions

View File

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

BIN
hmm Executable file

Binary file not shown.