CLI: Change help flag from -h to -?#40236
Open
dkbennett wants to merge 1 commit intofeature/wsl-for-appsfrom
Open
CLI: Change help flag from -h to -?#40236dkbennett wants to merge 1 commit intofeature/wsl-for-appsfrom
dkbennett wants to merge 1 commit intofeature/wsl-for-appsfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the WSLC CLI’s short help flag alias to align with Docker’s evolving conventions by switching from -h to -?, and adjusts test expectations accordingly.
Changes:
- Change the WSLC help alias macro from
hto?(so help is available via-?and--help). - Update E2E help-output expectations across container/image/registry/global help tests to show
-?,--help. - Update parser/command-line test cases to use
-?(including adjoined short-flag chains).
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/windows/wslc/e2e/WSLCE2ERegistryTests.cpp | Updates expected registry help text to show -?,--help. |
| test/windows/wslc/e2e/WSLCE2EPushPullTests.cpp | Updates expected push/pull help text to show -?,--help. |
| test/windows/wslc/e2e/WSLCE2EImageTests.cpp | Updates expected image command help text to show -?,--help. |
| test/windows/wslc/e2e/WSLCE2EImageTagTests.cpp | Updates expected image tag help text to show -?,--help. |
| test/windows/wslc/e2e/WSLCE2EImageSaveTests.cpp | Updates expected image save help text to show -?,--help. |
| test/windows/wslc/e2e/WSLCE2EImageListTests.cpp | Updates expected image list help text to show -?,--help. |
| test/windows/wslc/e2e/WSLCE2EImageInspectTests.cpp | Updates expected image inspect help text to show -?,--help. |
| test/windows/wslc/e2e/WSLCE2EImageDeleteTests.cpp | Updates expected image delete help text to show -?,--help. |
| test/windows/wslc/e2e/WSLCE2EGlobalTests.cpp | Updates expected root/global help output to show -?,--help. |
| test/windows/wslc/e2e/WSLCE2EContainerTests.cpp | Updates expected container command help text to show -?,--help. |
| test/windows/wslc/e2e/WSLCE2EContainerStopTests.cpp | Updates expected stop help text to show -?,--help. |
| test/windows/wslc/e2e/WSLCE2EContainerRunTests.cpp | Updates expected run help text to show -?,--help. |
| test/windows/wslc/e2e/WSLCE2EContainerRemoveTests.cpp | Updates expected remove help text to show -?,--help. |
| test/windows/wslc/e2e/WSLCE2EContainerListTests.cpp | Updates expected list help text to show -?,--help. |
| test/windows/wslc/e2e/WSLCE2EContainerKillTests.cpp | Updates expected kill help text to show -?,--help. |
| test/windows/wslc/e2e/WSLCE2EContainerExecTests.cpp | Updates expected exec help text to show -?,--help. |
| test/windows/wslc/e2e/WSLCE2EContainerCreateTests.cpp | Updates expected create help text to show -?,--help. |
| test/windows/wslc/e2e/WSLCE2EContainerAttachTests.cpp | Updates expected attach help text to show -?,--help. |
| test/windows/wslc/ParserTestCases.h | Updates parser test vectors to use -? and -? in adjoined short-flag chains. |
| test/windows/wslc/CommandLineTestCases.h | Adds a command-line parsing test case for root -?. |
| src/windows/wslc/arguments/Argument.h | Changes WSLC_CLI_HELP_ARG from L"h" to L"?". |
yao-msft
approved these changes
Apr 18, 2026
OneBlue
approved these changes
Apr 18, 2026
AmelBawa-msft
approved these changes
Apr 18, 2026
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
Docker has deprecated the common '-h' flag for help, as it conflicts with the '-h' flag used as an alias for "--host" in some subcommands. Its use is not universal on docker and likely to create confusion or conflict in the future. For compatibility with Docker usage patterns, we need to change or remove -h.
Here we change it to '-?' as that does not conflict with anything in Docker (and is unlikely to since it needs to be escaped in many unix shells), and is often used in Windows and many tools as a compatibility shorthand for help. Examples: Windows Terminal, PowerShell, WinGet, perl, Python, the old command help switch like "dir /?", etc.
This PR is just changing the character alias to '?' and updating all tests which utilize the flag or expect it in output.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Changed the alias for help to "-?"
Updated tests which expect -h to be -?.
Validation Steps Performed
Manual validation, unit tests.