Fix: CLI generate command works with single invocation #4

Merged
jakob merged 1 commits from issue-2 into main 2026-04-10 14:18:01 +02:00
Collaborator

Summary

  • Fix bug where CLI required specifying generate twice to work
  • The remove_env_flags function was incorrectly returning index 0 when no --env flag was present
  • This caused the first argument (program name) to be skipped incorrectly
  • Added early return when env_idx == 0 to preserve args when no --env flag exists

Commit: 460bb46

## Summary - Fix bug where CLI required specifying generate twice to work - The remove_env_flags function was incorrectly returning index 0 when no --env flag was present - This caused the first argument (program name) to be skipped incorrectly - Added early return when env_idx == 0 to preserve args when no --env flag exists Commit: 460bb46
opencode added 2 commits 2026-04-10 14:06:24 +02:00
The remove_env_flags function was incorrectly returning index 0 when no --env
flag was present, causing it to mistakenly skip the first argument
(program name) and shift all arguments incorrectly.

This required users to specify 'generate' twice to make the CLI work.

Fix by checking if --env was actually found (env_idx > 0) before removing
any arguments from the list.
jakob merged commit 79fd57401e into main 2026-04-10 14:18:01 +02:00
jakob deleted branch issue-2 2026-04-10 14:18:01 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jakob/rusty-petroleum#4