about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-08-27 13:01:28 -0400
committerJune McEnroe <june@causal.agency>2018-08-27 13:01:28 -0400
commit76350f1e602f1dcbea28063fa215b732e507d525 (patch)
tree2244f64fc570088a6d3767f50f6df609540b762b
parentMap modifyCount on log scale (diff)
downloadtorus-76350f1e602f1dcbea28063fa215b732e507d525.tar.gz
torus-76350f1e602f1dcbea28063fa215b732e507d525.zip
Dump HELP_DATA with client -h
-rw-r--r--client.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/client.c b/client.c
index 062c2e6..eafea91 100644
--- a/client.c
+++ b/client.c
@@ -667,7 +667,17 @@ static void readInput(void) {
 	}
 }
 
-int main() {
+int main(int argc, char *argv[]) {
+	int opt;
+	while (0 < (opt = getopt(argc, argv, "h"))) {
+		if (opt == 'h') {
+			fwrite(HELP_DATA, sizeof(HELP_DATA), 1, stdout);
+			return EX_OK;
+		} else {
+			return EX_USAGE;
+		}
+	}
+
 	curse();
 	modeHelp();
 	readInput();