From 905906fc0516443d60dd3eff981047241dff9b6f Mon Sep 17 00:00:00 2001 From: nour Date: Sat, 18 Oct 2025 16:02:18 +0300 Subject: [PATCH] Show closer matches for invalid site names --- sherlock_project/sherlock.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sherlock_project/sherlock.py b/sherlock_project/sherlock.py index 75b3e3d70..1df04e395 100644 --- a/sherlock_project/sherlock.py +++ b/sherlock_project/sherlock.py @@ -28,6 +28,7 @@ import requests from requests_futures.sessions import FuturesSession +from difflib import get_close_matches from sherlock_project.__init__ import ( __longname__, @@ -803,6 +804,12 @@ def main(): if site_missing: print(f"Error: Desired sites not found: {', '.join(site_missing)}.") + + available_site_names = [site.name for site in sites] + for m in site_missing: + matches = get_close_matches(m, available_site_names, n = 2, cutoff=0.4) + if matches: + print(f"Did you mean: {', '.join(matches)}.") if not site_data: sys.exit(1)