Skip to content

refactor: deduplicate PowerShell shortcut usage dispatch - #44

Merged
JacobOptimiza merged 1 commit into
mainfrom
refactor/powershell-shortcut-dispatch
Aug 16, 2026
Merged

refactor: deduplicate PowerShell shortcut usage dispatch#44
JacobOptimiza merged 1 commit into
mainfrom
refactor/powershell-shortcut-dispatch

Conversation

@JacobOptimiza

Copy link
Copy Markdown
Owner

Problem

Invoke-DevShortcutCommand (default branch) and Invoke-DevNavigator (dev shortcut with no items) each contained the same English usage throw duplicated twice consecutively before the Spanish throw — a known copy-paste defect in the shortcut dispatch flow.

Refactor

  • New private helper Resolve-DevShortcutUsageError (approved verb, not exported): consults the language and throws the exact existing EN or ES usage message.
  • Both dispatch points now call the helper; the duplicated if blocks are gone. Behavior-preserving: identical messages, identical throws, same public API/exports, no config format or Rust CLI changes. (Audited the whole module for the same pattern: no other occurrences.)

Regressions

  • Invoke-DevShortcutCommand too-many-args usage: EN and ES messages asserted (new).
  • Invoke-DevNavigator -Command shortcut with no arguments: EN and ES usage asserted (new).
  • Existing valid paths re-verified: remove, command-only, alias+command, plus persistence round-trip.

Coverage post

PowerShell commands 565/673 (83.95%), lines 360/431 (83.53%) — both gates >= 80% PASS (denominator shrank with the removed duplicate lines). Pester: 118 passed / 0 failed.

Gates

validate-powershell (parser + PSScriptAnalyzer) OK · Pester + coverage gate OK · cargo test 171 OK · node bootstrap tests OK · git diff --check OK.

@JacobOptimiza
JacobOptimiza merged commit eaac412 into main Aug 16, 2026
11 checks passed
@JacobOptimiza
JacobOptimiza deleted the refactor/powershell-shortcut-dispatch branch August 16, 2026 20:38
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.

1 participant