-
Notifications
You must be signed in to change notification settings - Fork 440
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
,rsync
includes the file. - If a file doesn't match
pattern1
but matchespattern2
,rsync
excludes the file. - If a file doesn't match
pattern1
orpattern2
but matchespattern3
,rsync
includes the file. - If a file doesn't match
pattern1
,pattern2
orpattern3
but matchespattern4
,rsync
excludes the file. - If a file doesn't match
pattern1
,pattern2
,pattern3
orpattern4
,rsync
uses 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.