Skip to content

feat: allow multiple -preset option#10

Merged
Warashi merged 3 commits into
mainfrom
use-multiple-presets
Jul 8, 2025
Merged

feat: allow multiple -preset option#10
Warashi merged 3 commits into
mainfrom
use-multiple-presets

Conversation

@Warashi
Copy link
Copy Markdown
Owner

@Warashi Warashi commented Jul 8, 2025

This PR allows us to use multiple -preset options.
The allow-lists are merged when we use the -preset option multiple times.

Warashi and others added 3 commits July 8, 2025 11:54
- Changed preset field from string to []string in flags struct
- Added custom flag handling for multiple --preset values (similar to --allow)
- Updated main() to process multiple presets in order, merging their allow-lists
- Each preset's paths are prepended to the final allow list
- AllowKeychain and AllowGit flags are ORed across all presets

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
When specifying multiple presets with overlapping paths, the same path
could appear multiple times in the allowed paths list. This change adds
deduplication logic to ensure each unique path appears only once.

The implementation:
- Uses a map[string]struct{} to track unique absolute paths
- Preserves the order of first occurrence
- Handles both preset paths and command-line paths
- Works correctly with relative paths and environment variables

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Warashi Warashi merged commit 71e142f into main Jul 8, 2025
9 checks passed
@Warashi Warashi deleted the use-multiple-presets branch July 8, 2025 04:18
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.

1 participant