aboutsummaryrefslogtreecommitdiff
path: root/bb.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-11-06 17:22:12 +0100
committerBruce Hill <bruce@bruce-hill.com>2019-11-06 17:22:12 +0100
commit8df4cceca0a27f192ae57bbc117674a8773082df (patch)
tree67d6165a1b0b57b45a27e49f3300a680de10a5dc /bb.h
parentd577fa5a5608350d94c14a53c2c8116dd7306462 (diff)
Added printing to `ask1` command
Diffstat (limited to 'bb.h')
-rw-r--r--bb.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/bb.h b/bb.h
index 9db73a4..d80f48b 100644
--- a/bb.h
+++ b/bb.h
@@ -264,6 +264,11 @@ static const char *bbcmdfn = "bb() {\n"
" printf \"%s\\0\" \"$arg\" >> $BBCMD;\n"
" done;\n"
"}\n"
+"butt() {\n"
+" input=\"$(cat)\"\n"
+" printf \"\\033[$(echo \"$input\" | wc -l)A\\033[J\" >/dev/tty\n"
+" echo \"$input\"\n"
+"}\n"
"ask() {\n"
#ifdef ASK
ASK ";\n"
@@ -290,7 +295,7 @@ ASK1 ";\n"
#ifdef CONFIRM
CONFIRM ";\n"
#else
-" ask1 REPLY \"\033[1mIs that okay? [y/N] \" && [ \"$REPLY\" = 'y' ];\n"
+" ask1 REPLY \"$1\033[0;1mIs that okay? [y/N] \" && [ \"$REPLY\" = 'y' ];\n"
#endif
"}\n"
"pause() {\n"