Add special help command to bypass git-man
ci/woodpecker/push/goreleaser Pipeline was successful Details

Signed-off-by: jolheiser <john.olheiser@gmail.com>
main
jolheiser 2022-09-03 21:52:56 -05:00
parent 37d0e9f29b
commit 8d5ec322a3
Signed by: jolheiser
GPG Key ID: B853ADA5DA7BBF7A
1 changed files with 18 additions and 13 deletions

View File

@ -38,7 +38,7 @@ func New() (*ffcli.Command, error) {
versionFlag := fs.Bool("version", false, "Print git-ea version")
fs.BoolVar(versionFlag, "v", *versionFlag, "--version")
return &ffcli.Command{
c := &ffcli.Command{
Name: "git-ea",
FlagSet: fs,
ShortUsage: "git-ea <cmd>",
@ -52,21 +52,26 @@ func New() (*ffcli.Command, error) {
handler.Init(),
handler.PR(),
},
Exec: func(_ context.Context, _ []string) error {
if *versionFlag {
log.Info().Msgf("git-ea v%s", Version)
}
c.Exec = func(_ context.Context, _ []string) error {
if *versionFlag {
log.Info().Msgf("git-ea v%s", Version)
return nil
}
dir := cfg.Base
if fs.NArg() > 0 {
if strings.EqualFold(fs.Arg(0), "help") {
fmt.Println(ffcli.DefaultUsageFunc(c))
return nil
}
dir = cfg.WorkspaceBranch(fs.Arg(0))
}
dir := cfg.Base
if fs.NArg() > 0 {
dir = cfg.WorkspaceBranch(fs.Arg(0))
}
fmt.Println(dir)
return nil
},
}, nil
fmt.Println(dir)
return nil
}
return c, nil
}
func (h *Handler) checkInit() error {