File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,10 @@ and document type declarations too.)""")
9
9
10
10
parser .add_argument ("in_path" )
11
11
parser .add_argument ("out_path" )
12
- parser .add_argument ("filter" , nargs = argparse .REMAINDER ,
13
- help = "Additional names to filter." )
12
+ parser .add_argument ("--include" , action = 'append' , default = [],
13
+ help = "Additional names to include." )
14
+ parser .add_argument ("--exclude" , action = 'append' , default = [],
15
+ help = "Additional names to exclude." )
14
16
15
17
args = parser .parse_args ()
16
18
@@ -22,7 +24,10 @@ filtered_data_elements = []
22
24
for element in root .iterfind ("data" ):
23
25
name = element .get ("name" )
24
26
if name :
25
- if not name .endswith (".Text" ) or name in args .filter :
27
+ excluded = name in args .exclude
28
+ included = name .endswith (".Text" ) or name in args .include
29
+
30
+ if excluded or not included :
26
31
filtered_data_elements .append (element )
27
32
28
33
for element in filtered_data_elements :
You can’t perform that action at this time.
0 commit comments