Compare commits
3 Commits
73b5eee664
...
6bedd37ac7
| Author | SHA1 | Date | |
|---|---|---|---|
| 6bedd37ac7 | |||
| 2909bf14b6 | |||
| d8871acf7e |
File diff suppressed because it is too large
Load Diff
13
src/main.rs
13
src/main.rs
@@ -205,6 +205,10 @@ fn main() {
|
|||||||
compile_to_c(&args[2], output_path, run_after, emit_c);
|
compile_to_c(&args[2], output_path, run_after, emit_c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
"repl" => {
|
||||||
|
// Start REPL
|
||||||
|
run_repl();
|
||||||
|
}
|
||||||
"doc" => {
|
"doc" => {
|
||||||
// Generate API documentation
|
// Generate API documentation
|
||||||
generate_docs(&args[2..]);
|
generate_docs(&args[2..]);
|
||||||
@@ -214,7 +218,7 @@ fn main() {
|
|||||||
if !std::path::Path::new(cmd).exists() && !cmd.starts_with('-') && !cmd.contains('.') && !cmd.contains('/') {
|
if !std::path::Path::new(cmd).exists() && !cmd.starts_with('-') && !cmd.contains('.') && !cmd.contains('/') {
|
||||||
let known_commands = vec![
|
let known_commands = vec![
|
||||||
"fmt", "lint", "test", "watch", "init", "check", "debug",
|
"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);
|
let suggestions = diagnostics::find_similar_names(cmd, known_commands.into_iter(), 2);
|
||||||
if !suggestions.is_empty() {
|
if !suggestions.is_empty() {
|
||||||
@@ -229,8 +233,8 @@ fn main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Start REPL
|
// No arguments — show help
|
||||||
run_repl();
|
print_help();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,7 +244,8 @@ fn print_help() {
|
|||||||
println!();
|
println!();
|
||||||
println!("{}", bc("", "Usage:"));
|
println!("{}", bc("", "Usage:"));
|
||||||
println!();
|
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, "<file.lux>"));
|
println!(" {} {} Run a file (interpreter)", bc(colors::CYAN, "lux"), c(colors::YELLOW, "<file.lux>"));
|
||||||
println!(" {} {} {} Compile to native binary", bc(colors::CYAN, "lux"), bc(colors::CYAN, "compile"), c(colors::YELLOW, "<file.lux>"));
|
println!(" {} {} {} Compile to native binary", bc(colors::CYAN, "lux"), bc(colors::CYAN, "compile"), c(colors::YELLOW, "<file.lux>"));
|
||||||
println!(" {} {} {} {} Compile with output name", bc(colors::CYAN, "lux"), bc(colors::CYAN, "compile"), c(colors::YELLOW, "<f>"), c(colors::YELLOW, "-o app"));
|
println!(" {} {} {} {} Compile with output name", bc(colors::CYAN, "lux"), bc(colors::CYAN, "compile"), c(colors::YELLOW, "<f>"), c(colors::YELLOW, "-o app"));
|
||||||
|
|||||||
Reference in New Issue
Block a user