containerd / nerdctl

contaiNERD CTL - Docker-compatible CLI for containerd, with support for Compose, Rootless, eStargz, OCIcrypt, IPFS, ...
Apache License 2.0
7.67k stars 570 forks source link

Incorrect usage is displayed when running nerdctl without any command #3185

Open narharim opened 1 week ago

narharim commented 1 week ago

Description

Without any command passed to client, it's display [flags] instead of [command] in usage

Steps to reproduce the issue

  1. Run go build . inside cmd/nerdctl
  2. Run ./nerdctl

Describe the results you received and expected

Received Usage: nerdctl [flags]

Expected Usage: nerdctl [command]

What version of nerdctl are you using?

v2.0.0-rc.0

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

Host information

No response

narharim commented 1 week ago

https://github.com/containerd/nerdctl/blob/bc24aa95d8b2b0b2342b88fbf97d1a44a961aac2/cmd/nerdctl/main.go#L55 I think this line should be replaced with if c != c.Root()

narharim commented 1 week ago

@AkihiroSuda I would like to raise a PR for this.