Example #1
0
int
ecmd_flush(int argc, char *argv[])
{
   char ch;
   char *time_format = "%Y %m %d %H:%M:%S";

   optreset = 1;
   optind = 0;
   while ((ch = getopt(argc, argv, "t:")) != -1) {
      switch (ch) {
         case 't':
            if ((time_format = strdup(optarg)) == NULL)
               err(1, "%s: strdup of time_format failed", argv[0]);
            break;
         case '?':
         case 'h':
         default:
            errx(1, "usage: %s [-t format]", argv[0]);
      }
   }
   
   medialib_load(db_file, playlist_dir);
   medialib_db_flush(stdout, time_format);
   medialib_destroy();
   return 0;
}
Example #2
0
static void
ecmd_flush_exec(UNUSED int argc, UNUSED char **argv)
{
   medialib_load(db_file, playlist_dir);
   medialib_db_flush(stdout, time_format);
   medialib_destroy();
}