CLI: Make container id required for stop command#41108
Open
dkbennett wants to merge 1 commit into
Open
Conversation
6 tasks
Contributor
There was a problem hiding this comment.
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::ContainerIdas required (and still allowing multiple IDs) forcontainer stop. - Updated command-line parsing test cases to assert failure when
stop/container stopis 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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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