Skip to content

fix: accept session names after option terminator - #3222

Open
akbash-bot wants to merge 1 commit into
herdrdev:masterfrom
akbash-bot:akbash/3220-delete-dash-session
Open

fix: accept session names after option terminator#3222
akbash-bot wants to merge 1 commit into
herdrdev:masterfrom
akbash-bot:akbash/3220-delete-dash-session

Conversation

@akbash-bot

Copy link
Copy Markdown
Collaborator

Issue

A user can create a session named -h or --json, but cannot delete it from the CLI. Even the escaped command with -- prints usage and leaves the session behind.

Problem

The session command parser treated -- as a session name. It also treated every --json token as an output option, even after the option terminator.

How did we fix it?

Herdr now ends option parsing at --. The following token is passed to the existing stop or delete operation as the literal session name. Bare help flags and normal --json output remain unchanged.

Verification

The focused parser test failed before because -- -h returned usage error 2. It passes afterward, and isolated CLI checks deleted both -h and --json while bare -h still showed help. Formatting, clippy, Windows clippy, maintenance, architecture, and asset checks passed. Full nextest had nine environment failures that reproduce unchanged on the base commit; the remaining 3,516 tests passed.

refs #3220

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 25c1d288-ccca-457e-a564-181ad6df945a

📥 Commits

Reviewing files that changed from the base of the PR and between 6e8b138 and fec07b2.

📒 Files selected for processing (1)
  • src/cli.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The session name parser now supports -- as an option terminator. Arguments after it become the session name, including option-like values. A unit test verifies that -h and --json are not parsed as options after the terminator.

Changes

Session name parsing

Layer / File(s) Summary
Option terminator parsing and validation
src/cli.rs
parse_session_name_and_json stops option parsing after --. The test verifies that -h and --json become session names with JSON mode disabled.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to fec07

This localized CLI parser change allows session names beginning with dashes to be handled after -- while preserving normal help and output-option behavior; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: accepting session names after the option terminator.
Description check ✅ Passed The description directly explains the parsing problem, the fix, and the verification results. It is related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kangal-bot kangal-bot added the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Trigger automated AI reviews for pull requests admitted by the PR gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants