summary refs log tree commit diff
path: root/bin/when.y
diff options
context:
space:
mode:
Diffstat (limited to 'bin/when.y')
-rw-r--r--bin/when.y12
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/when.y b/bin/when.y
index 69ccc343..c94c5514 100644
--- a/bin/when.y
+++ b/bin/when.y
@@ -319,8 +319,16 @@ int main(int argc, char *argv[]) {
 	}
 
 	if (argc > 1) {
-		input = argv[1];
-		return yyparse();
+		if (strcmp(argv[1], "-")) {
+			input = argv[1];
+			return yyparse();
+		} else {
+			for (size_t i = 0; i < dates.len; ++i) {
+				printf("%s: ", dates.ptr[i].tm_zone);
+				printScalar(dateDiff(today(), dates.ptr[i]));
+			}
+			return EX_OK;
+		}
 	}
 
 	struct tm date = today();