f156f455d40ab4db874c3a5100418f3434ece3d2
9 #include "khatus_lib_log.h"
10 #include "khatus_lib_time.h"
20 "OPT = -i int # interval\n"
21 " | -f string # format string\n"
22 " | -h # help message (i.e. what you're reading now :) )\n",
28 main(int argc
, char **argv
)
32 double opt_interval
= 1.0;
33 char *opt_fmt
= "%a %b %d %H:%M:%S";
40 memset(buf
, '\0', 128);
41 while ((c
= getopt(argc
, argv
, "f:i:h")) != -1)
44 opt_fmt
= calloc(strlen(optarg
), sizeof(char));
45 strcpy(opt_fmt
, optarg
);
48 opt_interval
= atof(optarg
);
56 ti
= timespec_of_float(opt_interval
);
59 strftime(buf
, sizeof(buf
), opt_fmt
, localtime(&t
));
This page took 0.072606 seconds and 3 git commands to generate.