Skip to content

CLI: Make container id required for stop command#41108

Open
dkbennett wants to merge 1 commit into
masterfrom
user/dkbennett/container_stop_req
Open

CLI: Make container id required for stop command#41108
dkbennett wants to merge 1 commit into
masterfrom
user/dkbennett/container_stop_req

Conversation

@dkbennett

Copy link
Copy Markdown
Member

Summary of the Pull Request

Changes the 'container stop' command to require at least one container id.

This is consistent with Docker CLI's container stop command, which also requires at least one.
Reference: https://docs.docker.com/reference/cli/docker/container/stop

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Set the container id to be required.
Updated command line tests to verify fail if it is not provided.

Validation Steps Performed

Copilot AI review requested due to automatic review settings July 17, 2026 19:54
@dkbennett
dkbennett requested review from a team as code owners July 17, 2026 19:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the wslc container stop command so that at least one container ID positional argument is required, aligning behavior with Docker’s container stop CLI semantics.

Changes:

  • Marked ArgType::ContainerId as required (and still allowing multiple IDs) for container stop.
  • Updated command-line parsing test cases to assert failure when stop / container stop is invoked without a container ID.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
test/windows/wslc/CommandLineTestCases.h Updates CLI parsing expectations to fail when stop is invoked without a required container ID.
src/windows/wslc/commands/ContainerStopCommand.cpp Makes the container-id positional required for the stop command (while still allowing multiple IDs via NO_LIMIT).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants