From dc7b3bb05afdf983ed261497c2a8fd2c75766415 Mon Sep 17 00:00:00 2001 From: jonasbn Date: Sat, 25 Jan 2025 15:04:20 +0100 Subject: [PATCH] When the handler is not recignized, a list of known handlers are appended to the error message indicating this --- src/main.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.m b/src/main.m index 020bddb..6f3e460 100644 --- a/src/main.m +++ b/src/main.m @@ -58,6 +58,7 @@ int main(int argc, const char *argv[]) { char *mark = [key caseInsensitiveCompare:current_handler_name] == NSOrderedSame ? "* " : " "; printf("%s%s\n", mark, [key UTF8String]); } + } else { NSString *target_handler_name = [NSString stringWithUTF8String:target]; @@ -71,7 +72,10 @@ int main(int argc, const char *argv[]) { set_default_handler(@"http", target_handler); set_default_handler(@"https", target_handler); } else { - printf("%s is not available as an HTTP handler\n", target); + printf("%s is not available as an HTTP handler\n\nAvailable HTTP handlers are:\n", target); + for (NSString *key in handlers) { + printf(" %s\n", [key UTF8String]); + } return 1; }