Strip the "v" prefix when displaying gh version string

This commit is contained in:
Mislav Marohnić 2019-11-27 16:42:13 +01:00
parent b21b93abe9
commit 4ec31ffd57

View file

@ -3,6 +3,7 @@ package command
import (
"fmt"
"os"
"strings"
"github.com/github/gh-cli/api"
"github.com/github/gh-cli/context"
@ -17,7 +18,7 @@ var Version = "DEV"
var BuildDate = "YYYY-MM-DD"
func init() {
RootCmd.Version = fmt.Sprintf("%s (%s)", Version, BuildDate)
RootCmd.Version = fmt.Sprintf("%s (%s)", strings.TrimPrefix(Version, "v"), BuildDate)
RootCmd.PersistentFlags().StringP("repo", "R", "", "current GitHub repository")
RootCmd.PersistentFlags().StringP("current-branch", "B", "", "current git branch")
// TODO: