-
Notifications
You must be signed in to change notification settings - Fork 446
Description
Is there a way to define rsync-style --include and --exclude commands where the order of these commands relative to each other is important? In rsync the first --include or --exclude in the command line that a file matches determines whether the file is included or not.
For example, consider rsync --include=pattern1 --exclude=pattern2 --include=pattern3 --exclude=pattern4.
- If a file matches
pattern1,rsyncincludes the file. - If a file doesn't match
pattern1but matchespattern2,rsyncexcludes the file. - If a file doesn't match
pattern1orpattern2but matchespattern3,rsyncincludes the file. - If a file doesn't match
pattern1,pattern2orpattern3but matchespattern4,rsyncexcludes the file. - If a file doesn't match
pattern1,pattern2,pattern3orpattern4,rsyncuses some default handling for the file.
If I use a list @Option for --include and a separate list @Option for --exclude, the order between includes and the order between excludes is preserved but not the order between includes and excludes.
If I use a list @Option for both --include and --exclude as names, then the order between includes and excludes is preserved, but I don't see a way to know which were includes and which were excludes.