New find action -hide, new find test -hidden

This commit is contained in:
2010-06-20 07:22:24 +00:00
parent ea5edd0a59
commit 3e0c8581fa
11 changed files with 177 additions and 53 deletions

View File

@ -686,6 +686,33 @@ not_enough_arguments:;
Findjob_set_filter_filter(job, -1, 0);
} else if(strcmp(argv[i], "-has_md5")==0) {
Findjob_set_prop_filter(job, 15, 1, 0);
} else if(strcmp(argv[i], "-disk_name")==0) {
if(i+1>=end_idx)
goto not_enough_arguments;
i++;
ret= Findjob_set_name_expr(job, argv[i], 2);
if(ret<=0) {
sprintf(xorriso->info_text,
"-find[ix]: cannot set -disk_name expression %s",
Text_shellsafe(argv[i], sfe, 0));
goto sorry_ex;
}
} else if(strcmp(argv[i], "-hidden")==0) {
if(i + 1 >= end_idx)
goto not_enough_arguments;
i+= 1;
type= Xorriso__hide_mode(argv[i], 0);
if(type < 0) {
sprintf(xorriso->info_text, "-findi: -hidden : unknown hide state %s",
Text_shellsafe(argv[i], sfe, 0));
goto sorry_ex;
} else {
ret= Findjob_set_test_hidden(job, type, 0);
if(ret <= 0) {
sprintf(xorriso->info_text, "-findi: cannot setup -hidden test");
goto sorry_ex;
}
}
} else if(strcmp(argv[i], "-true") == 0) {
ret= Findjob_set_false(job, -1, 0);
} else if(strcmp(argv[i], "-false") == 0) {
@ -937,6 +964,17 @@ not_enough_exec_arguments:;
i+= 1;
sscanf(argv[i], "%d", &type);
Findjob_set_action_type(job, 38, type, 0);
} else if(strcmp(cpt, "hide")==0) {
if(i+1>=end_idx)
goto not_enough_exec_arguments;
i++;
type= Xorriso__hide_mode(argv[i], 0);
if(type < 0) {
sprintf(xorriso->info_text, "-find -exec hide: unknown hide state %s",
Text_shellsafe(argv[i], sfe, 0));
goto sorry_ex;
}
Findjob_set_action_type(job, 39, type, 0);
} else {
sprintf(xorriso->info_text, "-find -exec: unknown action %s",
Text_shellsafe(argv[i], sfe, 0));