From a5a93473085dea8659be825a91bbfd01b7166474 Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Mon, 5 Sep 2022 21:59:56 +0200 Subject: Improve error message when you use -file as the verb. --- src/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index ef1b8dda1..31371b565 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2727,7 +2727,12 @@ int main(int arg_count, char const **arg_ptr) { if (!single_file_package) { gb_printf_err("ERROR: `%.*s %.*s` takes a package as its first argument.\n", LIT(args[0]), LIT(command)); - gb_printf_err("Did you mean `%.*s %.*s %.*s -file`?\n", LIT(args[0]), LIT(command), LIT(init_filename)); + if (init_filename == "-file") { + gb_printf_err("Did you mean `%.*s %.*s -file`?\n", LIT(args[0]), LIT(command)); + } else { + gb_printf_err("Did you mean `%.*s %.*s %.*s -file`?\n", LIT(args[0]), LIT(command), LIT(init_filename)); + } + gb_printf_err("The `-file` flag tells it to treat a file as a self-contained package.\n"); return 1; } else { -- cgit v1.2.3