docs(switch): refine wt switch --help text
Summary
Picks up the four wt switch --help refinements from #3095:
- Use backtick emphasis for shortcut symbols (
^,-,@,pr:{N},mr:{N}) instead of single quotes — matches the existing style on--base. - Surface PR/MR URL acceptance in the
[BRANCH]argument summary ("Branch name, shortcut, or PR/MR URL"), so the short help mirrors what the long help already documents. - Rewrite the Forks paragraph as prose, opening with "If the PR or MR is on a fork…" and using descriptive mood ("requires renaming") instead of imperative ("rename it first"). Drops the
(e.g., feature-fix)example. - Consolidate the per-forge notes — the Requires line, the standalone Gitea (experimental) paragraph, and the standalone Azure DevOps (experimental) paragraph — into a single footer pointing at forge platform for the platform-specific setup.
Before / after — Pull requests and merge requests section
Before:
Both work anywhere a branch is accepted, including
--base.Requires
gh(GitHub) orglab(GitLab) CLI to be installed and authenticated. The--createflag cannot be used with a PR/MR reference since the branch already exists.Forks: The local branch uses the PR/MR's branch name directly (e.g.,
feature-fix), sogit pushworks normally. If a local branch with that name already exists tracking something else, rename it first.Gitea (experimental):
pr:is also compatible with Gitea via theteaCLI. Set[forge] platform = "gitea"in.config/wt.tomlto opt in; worktrunk also auto-detects Gitea when the remote host containsgiteaor whentea login addhas been run for the host.Azure DevOps (experimental):
pr:is also compatible with Azure DevOps via theazCLI (with theazure-devopsextension). Set[forge] platform = "azure-devops"in.config/wt.tomlto opt in; worktrunk also auto-detects Azure DevOps fromdev.azure.comand*.visualstudio.comremotes.
After:
Both work anywhere a branch is accepted, including
--base. The--createflag cannot be used with a PR/MR reference since the branch already exists.If the PR or MR is on a fork, the local branch uses its branch name directly, so
git pushworks normally. A pre-existing local branch with that name tracking something else requires renaming first.Requires
gh(GitHub),glab(GitLab), or an equivalent CLI installed and authenticated; see forge platform for Gitea, Azure DevOps, and other supported platforms.
Testing
cargo test --test integration test_docs_are_in_sync— generated docs mirrors regenerated and now in sync.cargo test --test integration test_help— short and longswitch --helpsnapshots updated.cargo build— clean compile.- Inspected the rendered
wt switch --helpoutput to confirm the shortcuts render with bold emphasis and the consolidated footer reads cleanly.
Notes for review
- I did not sweep other
--helppages for parenthesized "e.g." examples — the issue mentioned looking for more, but I scoped this PR to the switch help and left the broader pass for a maintainer call. One other in-scope candidate atsrc/cli/mod.rs:569(Switching to a remote branch (e.g., wt switch feature when only origin/feature exists) creates a local tracking branch.) felt like a useful clarification of "remote branch" rather than a redundant example, so I left it alone. - The forge-platform link uses the
@/config.md#forge-platformform that the rest ofafter_long_helpuses for cross-doc references.
Closes #3095 — automated triage