This repository was archived by the owner on Nov 14, 2017. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +25
-9
lines changed
Expand file tree Collapse file tree 2 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,16 @@ class CommandLineArgs
2323 public CommandLineArgs ( string [ ] args )
2424 {
2525 OptionSet optionSet = GetOptionSet ( ) ;
26- optionSet . Parse ( args ) ;
26+
27+ try
28+ {
29+ optionSet . Parse ( args ) ;
30+ }
31+ catch ( OptionException ex )
32+ {
33+ Console . Error . WriteLine ( ex . Message ) ;
34+ Environment . Exit ( 1 ) ;
35+ }
2736
2837 if ( ShowHelp )
2938 {
Original file line number Diff line number Diff line change @@ -13,16 +13,23 @@ class Program
1313 {
1414 static void Main ( string [ ] args )
1515 {
16- CommandLineArgs cmdline = new CommandLineArgs ( args ) ;
16+ try
17+ {
18+ CommandLineArgs cmdline = new CommandLineArgs ( args ) ;
1719
18- // read *.NPK in NpkDir1
19- // read *.NPK in NpkDir2
20- // Compare
20+ // read *.NPK in NpkDir1
21+ // read *.NPK in NpkDir2
22+ // Compare
2123
22- NpkDirContents dir1Contents = GetNpkDirContents ( cmdline . NpkDir1 ) ;
23- NpkDirContents dir2Contents = GetNpkDirContents ( cmdline . NpkDir2 ) ;
24- NpkDirDifferences differences = dir1Contents . GetDifferences ( dir2Contents ) ;
25- DisplayDifferences ( differences ) ;
24+ NpkDirContents dir1Contents = GetNpkDirContents ( cmdline . NpkDir1 ) ;
25+ NpkDirContents dir2Contents = GetNpkDirContents ( cmdline . NpkDir2 ) ;
26+ NpkDirDifferences differences = dir1Contents . GetDifferences ( dir2Contents ) ;
27+ DisplayDifferences ( differences ) ;
28+ }
29+ catch ( Exception ex )
30+ {
31+ Console . Error . WriteLine ( "Unexpected error: {0}" , ex . Message ) ;
32+ }
2633 }
2734
2835 static NpkDirContents GetNpkDirContents ( string npkDir )
You can’t perform that action at this time.
0 commit comments