From 486dd096f22384be53a25ca2f9aff76723760a63 Mon Sep 17 00:00:00 2001 From: Fredrik Robertsen Date: Sun, 19 Apr 2026 01:04:58 +0200 Subject: [PATCH] migrate from scripts repo --- uash.ua | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 uash.ua diff --git a/uash.ua b/uash.ua new file mode 100755 index 0000000..3965310 --- /dev/null +++ b/uash.ua @@ -0,0 +1,46 @@ +#!/usr/bin/env uiua + +┌─╴CommandLine + # "~/..." ? cwd + Pretty ↚ ⊂@~▽⊸⬚@\0≠&var"HOME" + + COLORS ↚ map ⊙≡°□ ≡°⊟ [ + {"red" 1} {"green" 2} {"yellow" 3} {"blue" 4} + ] + ColorCode ↚ ˜⊂"\x1b[0m" ⊂$"\x1b[1;3_m" + C ↚ ( + ⨂{"truecolor"} □&var"COLORTERM" + ⨬(ColorCode get ⊙COLORS + | ◌ + ) + ) + + PS₁ ← &pf comptime(˜⊂ C"green" " λ " C"blue" Pretty °&cd) +└─╴ + +┌─╴Commands + # ? {"cd" ...} + CD ← ( + ⨂[0 1]⊸⧻ ↘1 + ⨬(&cd&var"HOME" + | ⍣&cd(&ep"cd: invalid path") ⊢ + | &ep"cd: too many arguments") + ) + + Otherwise ← ( + ⍣(°0&runi|&ep⊂"failed to run " /◇$"_ _") + ) +└─╴ + +┌─╴Main + F ← |1.0 ( + ⊜□⊸≠@\s + ⨂{"cd"}⊸⍣⊢"" + ⨬(Commands~CD + | Commands~Otherwise) + CommandLine~PS₁ + ) + + CommandLine~PS₁ + &rlF 0 +└─╴