add exit command

This commit is contained in:
2026-04-19 08:13:50 +02:00
parent 66de032617
commit 9d17be35d2

11
uash.ua
View File

@@ -27,6 +27,14 @@
| &ep"cd: too many arguments")
)
# ? {"exit" [code]}
Exit ← (
⨂[0 1]⊸⧻ ↘1
⨬(&exit 0
| &exit ⋕°□⊢
| &ep"exit: too many arguments")
)
Otherwise ← (
⍣(°0&runi|&ep⊂"failed to run " /◇$"_ _")
)
@@ -35,8 +43,9 @@
┌─╴Main
F ← |1.0 (
⊜□⊸≠@\s
⨂{"cd"}⊸⍣⊢""
⨂{"cd" "exit"}⊸⍣⊢""
⨬(Commands~CD
| Commands~Exit
| Commands~Otherwise)
CommandLine~PS₁
)