From 4e43c5e0608f6a3bd480cb89ac15504375a0847e Mon Sep 17 00:00:00 2001 From: "Lt. Byte" Date: Thu, 3 Sep 2026 09:47:00 +0200 Subject: [PATCH] feat(nav): helpful error for unknown destinations --- nav.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nav.py b/nav.py index ca03c84..eff3ebd 100644 --- a/nav.py +++ b/nav.py @@ -56,6 +56,9 @@ def plan(destination): def main(): destination = sys.argv[1] + if destination not in ROUTES: + known = ", ".join(sorted(ROUTES)) + sys.exit(f"Unknown destination: {destination} (known: {known})") route, total, days, fuel = plan(destination) print("Route: " + " -> ".join(NAMES[w] for w in route)) print(f"Distance: {total:.1f} million km")