Skip to content

Commit

Permalink
Update usage() function
Browse files Browse the repository at this point in the history
  • Loading branch information
Neved4 committed Jul 10, 2024
1 parent 77be060 commit de25ce1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions twc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit de25ce1

Please sign in to comment.