;run,repl: dont print unrecognized text, error out

This commit is contained in:
Dmitry Astapov 2025-02-28 12:19:30 +00:00 committed by Simon Michael
parent ef6b6ecc1b
commit 4a08f975f6

View File

@ -124,7 +124,7 @@ runCommand defaultJrnl findBuiltinCommand cmdline = do
"echo":args -> putStrLn $ unwords $ args
cmdname:args ->
case findBuiltinCommand cmdname of
Nothing -> putStrLn $ unwords (cmdname:args)
Nothing -> error' $ "Unrecognized command: " ++ unwords (cmdname:args)
Just (cmdmode,cmdaction) -> do
-- Even though expandArgsAt is done by the Cli.hs, it stops at the first '--', so we need
-- to do it here as well to make sure that each command can use @ARGFILEs