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