hashbert arrRuleFilter example
Assume hashcodes.txt looks like this
d404401c8c6495b206fc35c95e55a6d5 1474896174 3 a.txt
bfcc9da4f2e1d313c63cd0a4ee7604e9 1474896180 3 dir1/b.txt
And a ".hasbert-filter" file looking like this
+ d
- e
-
When running "hashbert check -F" then the two internal variables arrRuleFilter and boIncDefault becomes:
arrRuleFilter=[{str:"d", boInc:true}, {str:"e", boInc:false}];
boIncDefault=false; // The last rule with a prefix but no pattern.
Hence:
- "a.txt" doesn't match any rule so it is skipped because of boIncDefault==false.
- "dir1/b.txt" matches "d" so it is included.
Note:
- In this example the "- e" rule could have been skipped because such file would be skipped because boIncDefault==false.
- If "- e" rule is skipped then the arrRuleFilter only contains "include rules" which would make boIncDefault==false by default. So the line with a single "-" could also be skipped.