summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/man1/shotty.18
-rw-r--r--bin/shotty.c8
2 files changed, 13 insertions, 3 deletions
diff --git a/bin/man1/shotty.1 b/bin/man1/shotty.1
index 029bb036..9cc3c336 100644
--- a/bin/man1/shotty.1
+++ b/bin/man1/shotty.1
@@ -1,4 +1,4 @@
-.Dd July 12, 2019
+.Dd July 13, 2019
 .Dt SHOTTY 1
 .Os
 .
@@ -8,7 +8,7 @@
 .
 .Sh SYNOPSIS
 .Nm
-.Op Fl Bs
+.Op Fl Bcs
 .Op Fl b Ar bg
 .Op Fl f Ar fg
 .Op Fl h Ar rows
@@ -36,6 +36,10 @@ Replace bold with bright colors.
 Set the default background color.
 The default value is 0 (black).
 .
+.It Fl c
+Show the position of the cursor
+with reverse video.
+.
 .It Fl f Ar fg
 Set the default foreground color.
 The default value is 7 (white).
diff --git a/bin/shotty.c b/bin/shotty.c
index ea4115f1..9d193ca3 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
td>Use seprintf for snip, removing strlcpynJune McEnroe 2021-06-09Use seprintf for reserializeJune McEnroe 2021-06-09Use seprintf for capListJune McEnroe 2021-06-09Add seprintfJune McEnroe Based on seprint(2) from Plan 9. I'm not sure if my return value exactly matches Plan 9's in the case of truncation. seprint(2) is described only as returning a pointer to the terminating '\0', but if it does so even in the case of truncation, it is awkward for the caller to detect. This implementation returns end in the truncation case, so that (ptr == end) indicates truncation. 2021-05-27Add pounce-notify to README 2.4June McEnroe 2021-05-27Fix ENVIRONMENT formatting in pounce-notify(1)June McEnroe 2021-05-27Add note about Libera.Chat SASL-only rangesJune McEnroe 2021-05-25Add QUIRKS fileJune McEnroe 2021-05-19Replace freenode with tilde.chatJune McEnroe 2021-05-04notify: Reword pounce-notify manualJune McEnroe 2021-05-02Clean up Makefiles, configure scriptsJune McEnroe Default MANDIR to ${PREFIX}/man since it turns out man-db includes /usr/local/man by default. Add support for BINDIR. Separate libs out into LDADD variables. 2021-04-30palaver: Exit on getopt failureJune McEnroe Oops. 2021-04-30notify: Implement pounce-notifyJune McEnroe