URI:
       Added option to change date format. - tty-clock - port of tty-clock to OpenBSD, with pledge/unveil added as goodie.
  HTML git clone https://git.drkhsh.at/tty-clock.git
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit f119cd20b0a4ea3ff249043d00726e86bc74bb3a
   DIR parent d2459f135a9ff76cd0cab07ec5f60c15e076fa4d
  HTML Author: Tom Adams <tom@holizz.com>
       Date:   Fri, 10 Apr 2009 16:31:49 +0100
       
       Added option to change date format.
       
       Diffstat:
         M ttyclock.c                          |      12 ++++++++++--
         M ttyclock.h                          |       2 ++
       
       2 files changed, 12 insertions(+), 2 deletions(-)
       ---
   DIR diff --git a/ttyclock.c b/ttyclock.c
       @@ -158,7 +158,7 @@ update_hour(void)
             /* Set date string */
             strftime(ttyclock->date.datestr,
                 sizeof(ttyclock->date.datestr),
       -         "%d/%m/%Y",
       +         ttyclock->option.format,
                 ttyclock->tm);
        
             /* Set seconds */
       @@ -403,13 +403,18 @@ main(int argc, char **argv)
                       {"twelve",  0, NULL, 't'},
                       {"rebound", 0, NULL, 'r'},
                       {"center",  0, NULL, 'c'},
       +               {"format",  1, NULL, 'f'},
                       {NULL,      0, NULL, 0}
                  };
        
             /* Alloc ttyclock */
             ttyclock = malloc(sizeof(ttyclock_t));
        
       -     while ((c = getopt_long(argc,argv,"tvsrcih",
       +     /* Date format */
       +     ttyclock->option.format = malloc(sizeof(char)*100);
       +     strncpy(ttyclock->option.format, "%d/%m/%Y", 100);
       +
       +     while ((c = getopt_long(argc,argv,"tvsrcihf:",
                                     long_options, NULL)) != -1)
             {
                  switch(c)
       @@ -442,6 +447,9 @@ main(int argc, char **argv)
                  case 'r':
                       ttyclock->option.rebound = True;
                       break;
       +          case 'f':
       +               strncpy(ttyclock->option.format, optarg, 100);
       +               break;
                  }
             }
        
   DIR diff --git a/ttyclock.h b/ttyclock.h
       @@ -55,6 +55,7 @@
           -c, --center     Set the clock at the center of the terminal \n\
           -t, --twelve     Set the hour in 12h format                  \n\
           -r, --rebound    Do rebound the clock                        \n\
       +   -f, --format     Set the date format                         \n\
           -v, --version    Show tty-clock version                      \n\
           -i, --info       Show some info about tty-clock              \n\
           -h, --help       Show this page                              "
       @@ -74,6 +75,7 @@ typedef struct
                  Bool twelve;
                  Bool center;
                  Bool rebound;
       +          char *format;
             } option;
        
             /* Clock geometry */