@@ -107,27 +107,26 @@ public static void main(String[] args) throws ParseException {
107
107
String [] filePairSplit = line .split (" " );
108
108
109
109
if (filePairSplit .length != 2 ) {
110
- System .err .println ("Expected two file paths" );
110
+ System .out .println ("Expected two file paths" );
111
111
continue ;
112
112
}
113
113
114
+ File inFile = new File (filePairSplit [0 ]);
115
+ File outFile = new File (filePairSplit [1 ]);
116
+
114
117
try {
115
- File inFile = new File (filePairSplit [0 ]);
116
- File outFile = new File (filePairSplit [1 ]);
117
118
118
119
outFile = ValidateFilePair (inFile , outFile );
119
120
120
121
anonymizer .anonymize (inFile , outFile );
121
122
} catch (Exception e ) {
122
- System .err .println (e .getMessage ());
123
+ System .out .println ("[" + inFile + ":" + outFile + "] " + e .getMessage ());
123
124
continue ;
124
125
}
125
126
}
126
127
}
127
128
}
128
129
129
- int rc = 0 ;
130
-
131
130
if (
132
131
files .size () == 2 &&
133
132
!files .get (0 ).contains (":" ) &&
@@ -143,9 +142,14 @@ public static void main(String[] args) throws ParseException {
143
142
System .exit (1 );
144
143
}
145
144
146
- rc = anonymizer .anonymize (inFile , outFile );
145
+ try {
146
+ anonymizer .anonymize (inFile , outFile );
147
+ } catch (Exception e ) {
148
+ System .err .println (e .getMessage ());
149
+ System .exit (1 );
150
+ }
147
151
148
- System .exit (rc );
152
+ System .exit (0 );
149
153
}
150
154
151
155
List <File > filePairsToProcess = new ArrayList <File >();
@@ -183,14 +187,18 @@ public static void main(String[] args) throws ParseException {
183
187
}
184
188
185
189
for (int i = 0 ; i < filePairsToProcess .size (); i += 2 ) {
186
- rc =
190
+ try {
187
191
anonymizer .anonymize (
188
192
filePairsToProcess .get (i ),
189
193
filePairsToProcess .get (i + 1 )
190
194
);
195
+ } catch (Exception e ) {
196
+ System .err .println (e .getMessage ());
197
+ System .exit (1 );
198
+ }
191
199
}
192
200
193
- System .exit (rc );
201
+ System .exit (0 );
194
202
}
195
203
196
204
private static Options AddRequiredOptions (Options options ) {
0 commit comments