diff --git a/wordle_helper.py b/wordle_helper.py index e3fc753..0170085 100644 --- a/wordle_helper.py +++ b/wordle_helper.py @@ -22,6 +22,11 @@ def main() -> int: metavar="LETTERS", help="Exclude words containing any of these letters (case-insensitive)", ) + parser.add_argument( + "--contains", + metavar="LETTERS", + help="Only include words that contain all of these letters (case-insensitive)", + ) parser.add_argument( "--mask", metavar="PATTERN", @@ -50,6 +55,7 @@ def main() -> int: only_set = set(args.only.lower()) if args.only else None exclude_set = set(args.exclude.lower()) if args.exclude else None + contains_set = set(args.contains.lower()) if args.contains else None # Prepare matchers # Validate and normalize mask @@ -90,6 +96,8 @@ def main() -> int: return False if exclude_set is not None and (set(word.lower()) & exclude_set): return False + if contains_set is not None and not (contains_set <= set(word.lower())): + return False if mask_positions is not None: wl = word.lower() for i, ch in enumerate(mask_positions):