From 6bedd37ac71e75be5b66556a2799cdf76ad57488 Mon Sep 17 00:00:00 2001 From: Brandon Lucas Date: Wed, 18 Feb 2026 07:34:09 -0500 Subject: [PATCH] fix: show help menu when running lux with no arguments Previously `lux` with no args entered the REPL. Now it shows the help menu. Use `lux repl` to start the REPL explicitly. Co-Authored-By: Claude Opus 4.6 --- src/main.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 43d215d..7d81d62 100644 --- a/src/main.rs +++ b/src/main.rs @@ -205,6 +205,10 @@ fn main() { compile_to_c(&args[2], output_path, run_after, emit_c); } } + "repl" => { + // Start REPL + run_repl(); + } "doc" => { // Generate API documentation generate_docs(&args[2..]); @@ -214,7 +218,7 @@ fn main() { if !std::path::Path::new(cmd).exists() && !cmd.starts_with('-') && !cmd.contains('.') && !cmd.contains('/') { let known_commands = vec![ "fmt", "lint", "test", "watch", "init", "check", "debug", - "pkg", "registry", "serve", "compile", "doc", + "pkg", "registry", "serve", "compile", "doc", "repl", ]; let suggestions = diagnostics::find_similar_names(cmd, known_commands.into_iter(), 2); if !suggestions.is_empty() { @@ -229,8 +233,8 @@ fn main() { } } } else { - // Start REPL - run_repl(); + // No arguments — show help + print_help(); } } @@ -240,7 +244,8 @@ fn print_help() { println!(); println!("{}", bc("", "Usage:")); println!(); - println!(" {} Start the REPL", bc(colors::CYAN, "lux")); + println!(" {} Show this help", bc(colors::CYAN, "lux")); + println!(" {} Start the REPL", bc(colors::CYAN, "lux repl")); println!(" {} {} Run a file (interpreter)", bc(colors::CYAN, "lux"), c(colors::YELLOW, "")); println!(" {} {} {} Compile to native binary", bc(colors::CYAN, "lux"), bc(colors::CYAN, "compile"), c(colors::YELLOW, "")); println!(" {} {} {} {} Compile with output name", bc(colors::CYAN, "lux"), bc(colors::CYAN, "compile"), c(colors::YELLOW, ""), c(colors::YELLOW, "-o app"));