fix(wsh): accept block reference as positional arg for deleteblock (#3430)
## Summary The `wsh deleteblock` command previously only accepted a block reference via the `--block/-b` flag, with no Args validation, causing user confusion when positional arguments were silently ignored and the current block was deleted instead. ## Changes - Accept an optional positional block-ref argument (e.g. `wsh deleteblock 2`) - Add `Args: cobra.MaximumNArgs(1)` to validate argument count - Add Long description documenting accepted reference formats (block:oid, uuid, block number, keywords like 'this') - Add `resolveBlockArgWithOverride()` helper that prefers positional arg over `--block/-b` flag, defaulting to 'this' when neither is specified - Update Use string to show the optional `[block-ref]` argument ## Usage ```bash # Delete current block (default) wsh deleteblock # Delete block by number (1-indexed in current tab) wsh deleteblock 2 # Delete block by full ORef wsh deleteblock block:abc123-def456 # Delete block using -b flag (still supported) wsh deleteblock -b 2 ``` Fixes #3417
J
Jason-Shen2 committed
35dc57f1fa82ae5005d2e0ab816ed3876226c185
Parent: 086efc4
Committed by GitHub <noreply@github.com>
on 7/29/2026, 5:59:40 PM