improve c3c init error message (#2697)

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
This commit is contained in:
Chad Adams
2026-01-03 11:17:12 -05:00
committed by GitHub
parent 292bf1cbbc
commit fdbbe5c1aa

View File

@@ -371,7 +371,13 @@ static void parse_command(BuildOptions *options)
if (arg_match("init"))
{
options->command = COMMAND_INIT;
if (at_end() || next_is_opt()) error_exit("Expected a project name after init");
if (at_end() || next_is_opt())
{
error_exit("Error: Expected a project name after 'init'.\n\n"
"Usage: c3c init <project-name>\n\n"
"- Specify a project name (e.g., 'c3c init myproject') to create a new directory with that name containing the project structure.\n"
"- Use '.' (e.g., 'c3c init .') to initialize the project in the current working directory.");
}
options->project_name = next_arg();
return;
}