From 9d17be35d27b3a19650b614e210484c5460be090 Mon Sep 17 00:00:00 2001 From: Fredrik Robertsen Date: Sun, 19 Apr 2026 08:13:50 +0200 Subject: [PATCH] add exit command --- uash.ua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/uash.ua b/uash.ua index d522853..b0ad8a8 100755 --- a/uash.ua +++ b/uash.ua @@ -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₁ )