Repository navigation
fix(config): let --exclude-titles and --exclude-apps be repeated - #173
Merged
ErikBjare merged 1 commit intoNov 4, 2026
Merged
Conversation
The help text says --exclude-titles can be specified multiple times, but argparse kept only the last occurrence, so with `--exclude-titles bank --exclude-titles password` titles matching "bank" were still logged. --exclude-apps had the same problem. Use action="extend" so every occurrence counts. Patterns given on the command line still replace the ones from the config file.
[Medium impact] The PR appears safe to merge. SummaryRepeated
No actionable issues found. Tests were inspected but not run. Reviews (1) · Last reviewed commit: "fix(config): let --exclude-titles and --..." · Reviewed by Greptile |
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.
The help for
--exclude-titlessays "Can specify multiple times", but argparse kept only the last occurrence. With--exclude-titles bank --exclude-titles password, titles matchingbankwere still logged.--exclude-apps, described in #156 as taking multiple patterns, had the same problem: only the last app was excluded.Both flags now use
action="extend", so every occurrence counts, and several patterns after one flag still work. The config values are applied after parsing, because withextendargparse would add the command line patterns to the config list instead of replacing it (and fail on an invalid config value). Patterns given on the command line still replace the ones from the config file, as before.Added a test for both flags in
tests/test_config.py. It fails on master (only the last flag's patterns are kept) and passes with the fix. I also ran the realmain()with fake windows against a testing-mode aw-server-rust: before, a "Bank ..." title and a KeePassXC window were recorded; after, the title isexcludedand the app isn't logged. The command for the macOS Swift helper now gets all the patterns too.make testpasses on macOS with Python 3.9. Haven't tested Linux or Windows.