shithub: bin.rc

Download patch

ref: c30e1e6ba0303b7d50cbfb13686e69db0a512bdf
parent: 0ba323dbdbc78e4c6ccba79028997850d59b5bc6
author: kvik <kvik@a-b.xyz>
date: Sat Apr 18 22:16:53 EDT 2020

clear: aux/getflags

--- a/bin/clear
+++ b/bin/clear
@@ -1,7 +1,8 @@
 #!/bin/rc
-if(~ $1 -a){
-	>/dev/text
-	exit
-}
+rfork e
+flagfmt = 'a:clearall'
+eval `{aux/getflags} || aux/usage
+if(~ $clearall 1)
+	>/dev/text && exit
 </dev/text sed '/^'^$prompt(1)^'/q' | sed '$d' >/tmp/clear
 cat /tmp/clear >/dev/text