Add special help command to bypass git-man
ci/woodpecker/push/goreleaser Pipeline was successful
Details
ci/woodpecker/push/goreleaser Pipeline was successful
Details
Signed-off-by: jolheiser <john.olheiser@gmail.com>main
parent
37d0e9f29b
commit
8d5ec322a3
31
cmd/cmd.go
31
cmd/cmd.go
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue