summary refs log tree commit diff
path: root/bin/up.sh
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-07-09 23:35:52 -0400
committerJune McEnroe <june@causal.agency>2019-07-09 23:35:52 -0400
commit58542b1affb49206ecb8746dfa822dba232931a2 (patch)
treecacd8064646b3f67a9880366bbd752533ab9b349 /bin/up.sh
parentAdd options for default colors to shotty (diff)
downloadsrc-58542b1affb49206ecb8746dfa822dba232931a2.tar.gz
src-58542b1affb49206ecb8746dfa822dba232931a2.zip
Add up -c
Diffstat (limited to 'bin/up.sh')
-rw-r--r--bin/up.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/up.sh b/bin/up.sh
index 07a0b76b..ef3ff6c7 100644
--- a/bin/up.sh
+++ b/bin/up.sh
@@ -25,6 +25,13 @@ uploadText() {
 	upload "${temp}/input.txt"
 }
 
+uploadCommand() {
+	temp
+	echo "$ $*" > "${temp}/exec.txt"
+	"$@" >> "${temp}/exec.txt"
+	upload "${temp}/exec.txt"
+}
+
 uploadHi() {
 	temp
 	hi -f html -o document,anchor,tab=4 "$@" > "${temp}/hi.html"
@@ -38,10 +45,11 @@ uploadScreen() {
 	upload "${temp}/capture.png"
 }
 
-args=$(setopt 'hs' "$@")
+args=$(setopt 'chs' "$@")
 eval set -- "$args"
 for opt; do
 	case "$opt" in
+		(-c) shift; fn=uploadCommand;;
 		(-h) shift; fn=uploadHi;;
 		(-s) shift; fn=uploadScreen;;
 		(--) shift; break;;