From de883765a07700174e74d03162e77b990dbfbe0e Mon Sep 17 00:00:00 2001 From: knqyf263 Date: Tue, 8 Sep 2020 18:04:46 +0300 Subject: [PATCH] fix(cli): show help for subcommands --- internal/config/artifact.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/config/artifact.go b/internal/config/artifact.go index ac1935c11f0..b08af04f27b 100644 --- a/internal/config/artifact.go +++ b/internal/config/artifact.go @@ -1,6 +1,7 @@ package config import ( + "os" "strings" "time" @@ -36,7 +37,8 @@ func NewArtifactConfig(c *cli.Context) ArtifactConfig { func (c *ArtifactConfig) Init(ctx *cli.Context, logger *zap.SugaredLogger) (err error) { if c.Input == "" && ctx.Args().Len() == 0 { logger.Debug(`trivy requires at least 1 argument or --input option`) - cli.ShowAppHelpAndExit(ctx, 0) + _ = cli.ShowSubcommandHelp(ctx) + os.Exit(0) } else if ctx.Args().Len() > 1 { logger.Error(`multiple targets cannot be specified`) return xerrors.New("arguments error")