Skip to content

fix(args): support global flags before command name#39

Merged
RyanLee-Dev merged 1 commit intomainfrom
fix/global-flags-before-command
Apr 6, 2026
Merged

fix(args): support global flags before command name#39
RyanLee-Dev merged 1 commit intomainfrom
fix/global-flags-before-command

Conversation

@EElaineYIN
Copy link
Copy Markdown

Summary

  • scanCommandPath now accepts globalOptions schema to correctly skip flag values before the command path
  • Previously minimax --output json text chat would fail with "Unknown command: minimax json text chat"
  • All global flags with values (--api-key, --region, --output, --timeout, --base-url) now work in any position

Test plan

  • minimax --output json text chat --message "hello" --dry-run → works
  • minimax --timeout 30 text chat --message "hello" --dry-run → works
  • minimax --region cn image generate --prompt "cat" --dry-run → works
  • Normal flag-after-command usage unaffected

🤖 Generated with Claude Code

scanCommandPath now accepts globalOptions schema to correctly skip
flag values (e.g. --output json, --region cn) before the command path.
Previously `minimax --output json text chat` would fail with
"Unknown command: minimax json text chat".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@RyanLee-Dev RyanLee-Dev merged commit 597c678 into main Apr 6, 2026
2 checks passed
@RyanLee-Dev RyanLee-Dev deleted the fix/global-flags-before-command branch April 8, 2026 21:44
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.

2 participants