hub/commands/version.go

30 строки
493 B
Go
Исходник Обычный вид История

2013-05-29 22:58:46 +04:00
package commands
2013-04-09 08:53:13 +04:00
2013-05-24 10:16:00 +04:00
import (
"fmt"
2013-05-29 22:58:46 +04:00
"github.com/jingweno/gh/git"
"github.com/jingweno/gh/utils"
"os"
2013-05-24 10:16:00 +04:00
)
2013-12-20 03:05:34 +04:00
const Version = "0.26.0"
2013-05-24 10:16:00 +04:00
var cmdVersion = &Command{
Run: runVersion,
Usage: "version",
2013-05-24 18:25:50 +04:00
Short: "Show gh version",
2013-05-29 22:58:46 +04:00
Long: `Shows git version and gh client version.`,
2013-05-24 10:16:00 +04:00
}
2013-06-26 19:48:34 +04:00
func runVersion(cmd *Command, args *Args) {
2013-05-28 21:52:27 +04:00
gitVersion, err := git.Version()
2013-05-29 22:58:46 +04:00
utils.Check(err)
2013-05-28 21:52:27 +04:00
ghVersion := fmt.Sprintf("gh version %s", Version)
fmt.Println(gitVersion)
fmt.Println(ghVersion)
os.Exit(0)
2013-05-24 10:16:00 +04:00
}