fix(wsh): accept block reference as positional arg for deleteblock#3430
fix(wsh): accept block reference as positional arg for deleteblock#3430Jason-Shen2 wants to merge 1 commit into
Conversation
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. This also addresses issue wavetermdev#3417 where using -b BLOCKID appeared to delete the wrong block due to the unclear command interface. 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 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 argument Fixes wavetermdev#3417
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThe Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
The
wsh deleteblockcommand previously only accepted a block reference via the--block/-bflag, with no Args validation, causing user confusion when positional arguments were silently ignored and the current block was deleted instead.Changes
wsh deleteblock 2)Args: cobra.MaximumNArgs(1)to validate argument countresolveBlockArgWithOverride()helper that prefers positional arg over--block/-bflag, defaulting to 'this' when neither is specified[block-ref]argumentUsage
Fixes #3417