feat: normalize input to lowercase

This commit is contained in:
2026-03-09 19:25:25 +01:00
parent b15b5179fc
commit 901a17b2ca

View File

@@ -53,11 +53,12 @@ fn append_history(cmd: String) -> Nil {
}
fn repl_loop(cmds: dict.Dict(String, fn() -> Nil)) -> a {
let cmd = get_line("repl> ") |> string.trim
cmd |> append_history
let input = get_line("repl> ") |> string.trim
let cmd = string.lowercase(input)
input |> append_history
case dict.get(cmds, cmd) {
Ok(func) -> func()
Error(_) -> io.println(cmd <> ": unknown command")
Error(_) -> io.println(input <> ": unknown command")
}
repl_loop(cmds)
}