feat: Explain implicit new-tab arguments in root help menu (Fixes #9585)#20417
Open
ManyaS-Git wants to merge 1 commit into
Open
feat: Explain implicit new-tab arguments in root help menu (Fixes #9585)#20417ManyaS-Git wants to merge 1 commit into
ManyaS-Git wants to merge 1 commit into
Conversation
Here is your professional Git commit message and GitHub Pull Request description. You can copy and paste these directly into your terminal and GitHub! --- ### 📝 Git Commit Message ```text feat(cli): explain implicit new-tab arguments in root help menu Appends a footer to the root CLI parser help text (`wt /?`) explicitly stating that unrecognized arguments (such as `-d` and `-p`) are automatically passed to the `new-tab` subcommand. This resolves user confusion when common tab-creation arguments are omitted from the root help menu without breaking the CLI11 subcommand parsing logic. Includes proper localization locks to prevent translation of CLI keywords. Closes microsoft#9585 ``` --- ### 🚀 GitHub Pull Request **Title:** `feat: Explain implicit new-tab arguments in root help menu (Fixes microsoft#9585)` **Description:** ```markdown ## Summary Adds a descriptive footer to the root `wt` help menu explaining that unrecognized arguments are implicitly passed to the `new-tab` subcommand. Closes microsoft#9585. ## Problem When users execute `wt /?` or `wt --help`, the command-line options specifically tied to tab-creation (like `-d` for starting directory or `-p` for profile) are not listed. This creates confusion because users frequently pass these arguments directly to `wt` without realizing they are actually invoking the implicit `new-tab` subcommand. ## Root Cause The root CLI parser (`_app`) is configured as a prefix command to support implicit subcommand execution. `CLI11`'s help generation only lists arguments explicitly attached to the queried command, meaning arguments attached to `new-tab` are hidden when querying the root `wt` command's help. ## Solution Instead of duplicating argument definitions (which would break the subcommand fallback logic), this fix utilizes `CLI11`'s `footer()` API. We append a localized note to the end of the root help text clarifying the implicit `new-tab` behavior and providing an example. ## Testing - **Manual Verification:** Verified that running `wt /?` displays the localized footer. - **Localization Checks:** Added a `{Locked="..."}` comment block to `Resources.resw` to ensure automated translation tools do not mistakenly localize command-line string literals (e.g. `wt`, `new-tab`, `-d`). ## Screenshots (if applicable) *(N/A - CLI text change only)* ## Checklist - [x] Followed repository coding style - [x] Added necessary localization locking comments - [x] Kept commits focused and minimal - [x] Tested command-line output locally ```
Author
|
@microsoft-github-policy-service agree |
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
Adds a descriptive footer to the root
wthelp menu explaining that unrecognized arguments are implicitly passed to thenew-tabsubcommand. Closes #9585.Problem
When users execute
wt /?orwt --help, the command-line options specifically tied to tab-creation (like-dfor starting directory or-pfor profile) are not listed. This creates confusion because users frequently pass these arguments directly towtwithout realizing they are actually invoking the implicitnew-tabsubcommand.Root Cause
The root CLI parser (
_app) is configured as a prefix command to support implicit subcommand execution.CLI11's help generation only lists arguments explicitly attached to the queried command, meaning arguments attached tonew-tabare hidden when querying the rootwtcommand's help.Solution
Instead of duplicating argument definitions (which would break the subcommand fallback logic), this fix utilizes
CLI11'sfooter()API. We append a localized note to the end of the root help text clarifying the implicitnew-tabbehavior and providing an example.Testing
wt /?displays the localized footer.{Locked="..."}comment block toResources.reswto ensure automated translation tools do not mistakenly localize command-line string literals (e.g.wt,new-tab,-d).Screenshots (if applicable)
(N/A - CLI text change only)
Checklist