From 677e991bb539858a954b95e7a8e2980c3ec96f57 Mon Sep 17 00:00:00 2001 From: ningmingxiao Date: Tue, 6 Jan 2026 11:16:50 +0800 Subject: [PATCH] command: show help and exit on unknown positional arguments Signed-off-by: ningmingxiao --- cmd/containerd/command/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/containerd/command/main.go b/cmd/containerd/command/main.go index c18794a9c8..c4d58c1322 100644 --- a/cmd/containerd/command/main.go +++ b/cmd/containerd/command/main.go @@ -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)