fix(cli): accept remote connect flags before or after host name
Summary
reasonix remote connectused Go's defaultflag.Parse, which stops at the first positional. Documented forms likeremote connect <name> --open(help text + GUIDE) therefore failed and printed usage.- Parse both
<name> [flags]and[flags] <name>, keeping stdlib single-dash flags such as-open. - Add focused unit coverage for both orders and common error cases.
Issues
Fixes #7255
Verification
go test ./internal/cli/ -run TestParseRemoteConnectSyntaxFlagOrder
Cache impact
Cache-impact: none — CLI argument parsing only; no provider-visible prompt, tool schema, or compaction changes. Cache-guard: N/A — no cache-sensitive paths touched. System-prompt-review: N/A
Thank you, @skyzhao1223. Your core contribution from #7306 has been preserved and adapted in #7311, which is now merged into main-v2:
- both
remote connect <name> [flags]andremote connect [flags] <name>; - standard-library
-openandremote opencompatibility; - the focused parser and flag-order/error test matrix.
The integration commit fb9af7d3 records you with a public Co-authored-by trailer, so your contribution is preserved in the repository history as well as documented in the integration PR. #7311 additionally routes the parser through the shared CLI help/error contract: help exits with status 0, while malformed flags remain concise and exit with status 2.
The fix is now on main-v2 and will be included in the next release. The source branch was not modified.