1package commands 2 3import ( 4 "github.com/github/hub/ui" 5 "github.com/github/hub/version" 6) 7 8var cmdVersion = &Command{ 9 Run: runVersion, 10 Usage: "version", 11 Long: "Shows git version and hub client version.", 12 GitExtension: true, 13} 14 15func init() { 16 CmdRunner.Use(cmdVersion, "--version") 17} 18 19func runVersion(cmd *Command, args *Args) { 20 versionCmd := args.ToCmd() 21 versionCmd.Spawn() 22 ui.Printf("hub version %s\n", version.Version) 23 args.NoForward() 24} 25