feat: show command generate help if no input flags

main
sudo pacman -Syu 2022-08-16 01:02:47 +07:00
parent 6aced97056
commit e2ccc0e5d5
No known key found for this signature in database
GPG Key ID: D6CB5C6C567C47B0
1 changed files with 6 additions and 6 deletions

View File

@ -31,12 +31,12 @@ var (
func (a *action) RunGenerate(c *cli.Context) error { func (a *action) RunGenerate(c *cli.Context) error {
a.getFlags(c) a.getFlags(c)
if !a.flags.interactive { // Show help if there is no flags
// Show help if there is nothing and not in interactive mode if c.NumFlags() == 0 {
if c.NumFlags() == 0 { return cli.ShowCommandHelp(c, commandGenerateName)
return cli.ShowAppHelp(c) }
}
} else { if a.flags.interactive {
fmt.Printf("Input version (%s):\n", flagVersionUsage) fmt.Printf("Input version (%s):\n", flagVersionUsage)
a.flags.version = ioe.ReadInput() a.flags.version = ioe.ReadInput()