cli/main.go
Corey Johnson 817b154705 Get latest version
Co-Authored-By: Josh Abernathy <joshaber@gmail.com>
2019-11-20 11:07:17 -08:00

22 lines
401 B
Go

package main
import (
"fmt"
"os"
"strings"
"github.com/github/gh-cli/command"
)
func main() {
command.CheckForUpdate()
if cmd, err := command.RootCmd.ExecuteC(); err != nil {
fmt.Fprintln(os.Stderr, err)
_, isFlagError := err.(command.FlagError)
if isFlagError || strings.HasPrefix(err.Error(), "unknown command ") {
fmt.Fprintln(os.Stderr, cmd.UsageString())
}
os.Exit(1)
}
}