Add 'defaults' option. - #41
Open
richrd wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a defaults value to the --options argument of the modify action so users can apply a curated set of recommended mods with a single keyword instead of listing them all individually. The README is updated to document the new shortcut, and the internal option-matching code is refactored to operate on a local options variable (using set intersection for DB-mod detection) so the new expansion flows through unchanged.
Changes:
- Introduces a
DEFAULT_MODSconstant and expands--options defaultsinto that list (rejecting combinations with other options). - Replaces the convoluted
set(db_actions) - (set(db_actions) - set(args.options))check with a clearer set intersection, and routes all mod checks through the newoptionslocal. - Documents the new
defaultsshortcut and multi-option usage in the README and in--optionshelp text.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| README.md | Documents the new defaults option and clarifies that multiple mods can be passed at once. |
| op1repacker/main.py | Adds DEFAULT_MODS, handles the defaults keyword (with a guard against mixing it with other options), and switches mod checks to use the local options variable and a set-intersection-based DB-mod detection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Support a "defaults" option that applies all suggested mods | ||
| options = args.options | ||
| if "defaults" in options: | ||
| if (len(options) > 1): |
|
|
||
| # Support a "defaults" option that applies all suggested mods | ||
| options = args.options | ||
| if "defaults" in options: |
| if (len(options) > 1): | ||
| print('The "defaults" option cannot be combined with other options!') | ||
| return | ||
| print('Enabled default modifications: ' + ', '.join(DEFAULT_MODS)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add option for applying default mods.