command: show help and exit on unknown positional arguments

Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
This commit is contained in:
ningmingxiao
2026-01-06 11:16:50 +08:00
committed by ningmingxiao
parent 1be58315b6
commit 677e991bb5

View File

@@ -119,6 +119,10 @@ can be used and modified as necessary as a custom configuration.`
ociHook,
}
app.Action = func(cliContext *cli.Context) error {
if args := cliContext.Args(); args.First() != "" {
return cli.ShowCommandHelp(cliContext, args.First())
}
var (
start = time.Now()
signals = make(chan os.Signal, 2048)