fix: hide help sub-command & persist help flag

This commit is contained in:
decentral1se 2024-07-09 16:43:10 +02:00
parent 878247e46d
commit 4580ea9dc8
Signed by untrusted user: decentral1se
GPG Key ID: 03789458B3D0C410
6 changed files with 24 additions and 11 deletions

View File

@ -5,10 +5,11 @@ import (
)
var AppCommand = cli.Command{
Name: "app",
Aliases: []string{"a"},
Usage: "Manage apps",
ArgsUsage: "<domain>",
Name: "app",
Aliases: []string{"a"},
Usage: "Manage apps",
ArgsUsage: "<domain>",
HideHelpCommand: true,
Commands: []*cli.Command{
&appBackupCommand,
&appCheckCommand,

View File

@ -20,9 +20,10 @@ import (
)
var catalogueGenerateCommand = cli.Command{
Name: "generate",
Aliases: []string{"g"},
Usage: "Generate the recipe catalogue",
Name: "generate",
Aliases: []string{"g"},
Usage: "Generate the recipe catalogue",
HideHelpCommand: true,
Flags: []cli.Flag{
internal.NoInputFlag,
internal.PublishFlag,

View File

@ -167,6 +167,7 @@ func newAbraApp(version, commit string) *cli.Command {
},
EnableShellCompletion: true,
UseShortOptionHandling: true,
HideHelpCommand: true,
ShellComplete: autocomplete.SubcommandComplete,
}
@ -194,6 +195,13 @@ func newAbraApp(version, commit string) *cli.Command {
return nil
}
cli.HelpFlag = &cli.BoolFlag{
Name: "help",
Aliases: []string{"h, H"},
Usage: "Show help",
Persistent: true,
}
return app
}

View File

@ -19,6 +19,7 @@ for you.
Anyone who uses a recipe can become a maintainer. Maintainers typically make
sure the recipe is in good working order and the config upgraded in a timely
manner.`,
HideHelpCommand: true,
Commands: []*cli.Command{
&recipeFetchCommand,
&recipeLintCommand,

View File

@ -6,9 +6,10 @@ import (
// ServerCommand defines the `abra server` command and its subcommands
var ServerCommand = cli.Command{
Name: "server",
Aliases: []string{"s"},
Usage: "Manage servers",
Name: "server",
Aliases: []string{"s"},
Usage: "Manage servers",
HideHelpCommand: true,
Commands: []*cli.Command{
&serverAddCommand,
&serverListCommand,

View File

@ -480,7 +480,8 @@ func newAbraApp(version, commit string) *cli.Command {
\____\___/ \___/| .__/ \____|_|\___/ \__,_|\__,_|
|_|
`,
Version: fmt.Sprintf("%s-%s", version, commit[:7]),
Version: fmt.Sprintf("%s-%s", version, commit[:7]),
HideHelpCommand: true,
Commands: []*cli.Command{
&Notify,
&UpgradeApp,