summary refs log tree commit diff
path: root/bin/shotty.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-07-13 15:34:20 -0400
committerJune McEnroe <june@causal.agency>2019-07-13 15:34:20 -0400
commitd5f0da6bea8562cf1ae08ba5af2412eff30874a3 (patch)
tree145a4195770f61ac8e003ea1c60453bed6b11ac6 /bin/shotty.c
parentAdd DL to shotty (diff)
downloadsrc-d5f0da6bea8562cf1ae08ba5af2412eff30874a3.tar.gz
src-d5f0da6bea8562cf1ae08ba5af2412eff30874a3.zip
Add shotty -c
Diffstat (limited to 'bin/shotty.c')
-rw-r--r--bin/shotty.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/shotty.c b/bin/shotty.c
index 1e1c9537..87486990 100644
--- a/bin/shotty.c
+++ b/bin/shotty.c
@@ -300,14 +300,16 @@ int main(int argc, char *argv[]) {
 	setlocale(LC_CTYPE, "");
 
 	bool bright = false;
+	bool cursor = false;
 	bool size = false;
 	FILE *file = stdin;
 
 	int opt;
-	while (0 < (opt = getopt(argc, argv, "Bb:f:h:sw:"))) {
+	while (0 < (opt = getopt(argc, argv, "Bb:cf:h:sw:"))) {
 		switch (opt) {
 			break; case 'B': bright = true;
 			break; case 'b': def.bg = strtoul(optarg, NULL, 0);
+			break; case 'c': cursor = true;
 			break; case 'f': def.fg = strtoul(optarg, NULL, 0);
 			break; case 'h': rows = strtoul(optarg, NULL, 0);
 			break; case 's': size = true;
@@ -349,6 +351,10 @@ int main(int argc, char *argv[]) {
 		}
 	}
 
+	if (cursor) {
+		cell(y, x)->style.reverse ^= true;
+	}
+
 	printf(
 		"<pre style=\"width: %uch;\" class=\"bg%u fg%u\">",
 		cols, def.bg, def.fg