tt

A simple terminal timer
git clone git://git.laack.co/tt.git
Log | Files | Refs | README | LICENSE

commit 7c46a4947b705412738793ef1cbf4e01d390f9d2
parent 080c5ede54c8eba9f5c4496c6a0841578342589f
Author: Andrew Laack <andrew@laack.co>
Date:   Wed,  9 Sep 2026 20:53:08 -0500

Added makefile

Diffstat:
AMakefile | 11+++++++++++
Amain.c | 22++++++++++++++++++++++
2 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile @@ -0,0 +1,11 @@ +build: + tcc main.c -o tt + +run: build + ./tt 60 + +clean: + rm tt + + +full: build run clean diff --git a/main.c b/main.c @@ -0,0 +1,22 @@ +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> + +#define USAGE_STRING "usage: tt {num_minutes}\n" +#define INVALID_INPUT -1 + +int main(int argc, char** argv) { + if (argc <= 1 || argc > 2) { + printf(USAGE_STRING); + return INVALID_INPUT; + } + + char *end; + long value = strtol(argv[1], &end, 10); + if (end == argv[1] || *end != '\0' || errno == ERANGE) { + printf("Invalid number: %s\n", argv[1]); + return INVALID_INPUT; + } + + return 0; +}