Skip to content

[Bug]: container clean --help shows container IDs as optional, but clean without IDs fails #2523

Open

Description

@jaeyeonme

I have done the following

  • I have searched the existing issues
  • If possible, I've reproduced the issue using the 'main' branch of this project

Steps to reproduce

% container clean --help
OVERVIEW: Clean one or more running containers

USAGE: container clean [--debug] [<container-ids> ...]

ARGUMENTS:
  <container-ids>         Container IDs
...

% container clean
Error: no containers specified

% echo $?
1

Problem description

The usage line shows the container IDs as optional, but clean fails without them. Unlike stop, kill and delete, clean has no --all flag, so there is no case where the IDs can be omitted. docs/command-reference.md already lists them as required.

I'd expect the usage line to show the IDs as required and a missing ID to be reported as a usage error, as container inspect does. That changes the exit code for this case from 1 to 64.

I opened #2500 with that change before filing this issue, so the behavior can be agreed here. If you'd rather add clean --all to match stop, kill and delete, I can change the PR. This is one case of the zero-argument handling in #646.

Environment

- OS: macOS 27.2 (26B123)
- Xcode: Version 27.2 (27B52)
- Container: main (c05a560)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions