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
13
cmd/cmd.go
13
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,7 +52,8 @@ func New() (*ffcli.Command, error) {
|
||||||
handler.Init(),
|
handler.Init(),
|
||||||
handler.PR(),
|
handler.PR(),
|
||||||
},
|
},
|
||||||
Exec: func(_ context.Context, _ []string) error {
|
}
|
||||||
|
c.Exec = func(_ context.Context, _ []string) error {
|
||||||
if *versionFlag {
|
if *versionFlag {
|
||||||
log.Info().Msgf("git-ea v%s", Version)
|
log.Info().Msgf("git-ea v%s", Version)
|
||||||
return nil
|
return nil
|
||||||
|
@ -60,13 +61,17 @@ func New() (*ffcli.Command, error) {
|
||||||
|
|
||||||
dir := cfg.Base
|
dir := cfg.Base
|
||||||
if fs.NArg() > 0 {
|
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.WorkspaceBranch(fs.Arg(0))
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(dir)
|
fmt.Println(dir)
|
||||||
return nil
|
return nil
|
||||||
},
|
}
|
||||||
}, nil
|
return c, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Handler) checkInit() error {
|
func (h *Handler) checkInit() error {
|
||||||
|
|
Loading…
Reference in New Issue