Skip to content

CLI: Change help flag from -h to -?#40236

Open
dkbennett wants to merge 1 commit intofeature/wsl-for-appsfrom
user/dkbennett/helpflag
Open

CLI: Change help flag from -h to -?#40236
dkbennett wants to merge 1 commit intofeature/wsl-for-appsfrom
user/dkbennett/helpflag

Conversation

@dkbennett
Copy link
Copy Markdown
Member

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

  • 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

Changed the alias for help to "-?"
Updated tests which expect -h to be -?.

Validation Steps Performed

Manual validation, unit tests.

@dkbennett dkbennett requested a review from a team as a code owner April 17, 2026 22:25
Copilot AI review requested due to automatic review settings April 17, 2026 22:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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 h to ? (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"?".

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.

5 participants