提交 19c1ffa6 编写于 作者: J Jingwen Owen Ou

`gh help` to print help from `gh`

For `git help`, run `gh COMMAND --help`
上级 0ad8e04f
......@@ -3,8 +3,6 @@ package commands
import (
"flag"
"fmt"
"github.com/jingweno/gh/git"
"github.com/jingweno/gh/utils"
"strings"
)
......@@ -25,16 +23,11 @@ type Command struct {
}
func (c *Command) PrintUsage() {
if c.GitExtension {
err := git.SysExec(c.Name(), "--help")
utils.Check(err)
} else {
if c.Runnable() {
fmt.Printf("Usage: git %s\n\n", c.Usage)
}
fmt.Println(strings.Trim(c.Long, "\n"))
if c.Runnable() {
fmt.Printf("Usage: git %s\n\n", c.Usage)
}
fmt.Println(strings.Trim(c.Long, "\n"))
}
func (c *Command) Name() string {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册