From de25ce120a270c76f7bd6d25a020cc64e88141b6 Mon Sep 17 00:00:00 2001 From: Neveda <63655535+Neved4@users.noreply.github.com> Date: Wed, 10 Jul 2024 20:26:36 +0200 Subject: [PATCH] Update `usage()` function --- twc.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/twc.c b/twc.c index dff6cb1..b0fd2dd 100644 --- a/twc.c +++ b/twc.c @@ -19,8 +19,19 @@ const char *time_fmts[NTIMEFMT] = { const char *file = "/twc/tz.conf"; static void usage(const char *s) { - fprintf(stderr, "usage: %s [-h] [-s FORMAT] [-f FILE | -t TIMEZONE]\n", s); - exit(EXIT_FAILURE); + fprintf(stderr, + "usage: %s [-h] [-f path] [-s format] [-t timezone] ...\n\n" + "Options:\n" + " -f path\n" + " Read config from path (default \"$HOME/.config/twc/tz.conf\")\n" + " -h Print in human-readable format\n" + " -s format\n" + " Set desired time format (e.g. \"%%Y-%%m-%%d\")\n" + " -t timezone\n" + " Set a specific timezone (e.g. \"Asia/Tokyo\")\n", + s); + + exit(EXIT_FAILURE); } static void errmsg(const char *msg) {