File tree 1 file changed +7
-14
lines changed
1 file changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -289,26 +289,15 @@ int main(int argc, char** argv)
289
289
bool byteswap = (vm.count (" byteswap" ) > 0 );
290
290
bool quiet = (vm.count (" quiet" ) > 0 );
291
291
string dataType = DEFAULT_TYPE;
292
- try {
293
- if (vm.count (" type" ))
294
- dataType = vm[" type" ].as <string>();
295
- } catch (boost::bad_any_cast &e) {
296
- cerr << " While parsing command line options (type): " << e.what () << endl;
297
- return -1 ;
298
- }
292
+ if (vm.count (" type" ))
293
+ dataType = vm[" type" ].as <string>();
299
294
bool showLines = (vm.count (" lines" ) > 0 );
300
295
301
296
// hidden options
302
297
vector<string> files;
303
298
if (vm.count (" filename" ))
304
299
{
305
- try {
306
- files = vm[" filename" ].as <vector<string> >();
307
- } catch (boost::bad_any_cast &e) {
308
- cerr << " While parsing command line options (filename): " << e.what ()
309
- << endl;
310
- return -1 ;
311
- }
300
+ files = vm[" filename" ].as <vector<string> >();
312
301
}
313
302
else
314
303
{
@@ -352,6 +341,10 @@ int main(int argc, char** argv)
352
341
} catch (std::runtime_error &e) {
353
342
cerr << " RUNTIME ERROR:" << e.what () << endl;
354
343
return -1 ;
344
+ } catch (boost::bad_any_cast &e) {
345
+ cerr << " While parsing command line options: " << e.what ()
346
+ << endl;
347
+ return -1 ;
355
348
}
356
349
357
350
return 0 ;
You can’t perform that action at this time.
0 commit comments