--- orig/idutils-4.2/src/mkid.c 2006-07-22 05:38:03.000000000 +0200 +++ changed/idutils-4.2/src/mkid.c 2009-10-16 10:24:42.000000000 +0200 @@ -130,6 +130,7 @@ static struct option const long_options[] = { + { "list", required_argument, 0, 'L' }, { "file", required_argument, 0, 'f' }, { "output", required_argument, 0, 'o' }, { "include", required_argument, 0, 'i' }, @@ -207,10 +208,10 @@ bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); #endif - + char *listname = 0; for (;;) { - int optc = getopt_long (argc, argv, "o:f:i:x:l:m:d:p:vVs", + int optc = getopt_long (argc, argv, "L:o:f:i:x:l:m:d:p:vVs", long_options, (int *) 0); if (optc < 0) break; @@ -218,7 +219,9 @@ { case 0: break; - + case 'L': + listname = optarg; + break; case 'o': case 'f': idh.idh_file_name = optarg; @@ -275,20 +278,36 @@ argc -= optind; argv += optind; - /* If no file or directory options exist, walk the current directory. */ - if (argc == 0) - { - static char dot[] = "."; - static char *dotp = dot; - argc = 1; - argv = &dotp; - } - language_getopt (); assert_writeable (idh.idh_file_name); if (cw_dlink == 0) cw_dlink = init_walker (&idh); parse_language_map (lang_map_file_name); + /* If no file or directory options exist, walk the current directory. */ + if (argc == 0) + { + if(listname == 0) { + static char dot[] = "."; + static char *dotp = dot; + argc = 1; + argv = &dotp; + } + else { + char line[400]; + FILE *listfile = fopen (listname, "r"); + if ( listfile) + { + while( fgets(line, 400, listfile)) { + line[strlen(line)-1]=0; + struct file_link *flink = parse_file_name (line, cw_dlink); + if (flink) + walk_flink (flink, 0); + } + } + } + } + + /* Walk the file and directory names given on the command line. */ while (argc--)