@@ -36,7 +36,7 @@ class Program
3636 static string CursorType = "FIREHOSE" ; // FIREHOSE, DATASET, NONE (executing a non-row-returning command)
3737
3838
39- static void Main ( string [ ] args )
39+ static int Main ( string [ ] args )
4040 {
4141 //
4242 // Set command-line rules and parse the command-line
@@ -59,7 +59,7 @@ static void Main(string[] args)
5959 {
6060 Console . WriteLine ( "Bad arguments: " + ruleViolation ) ;
6161 displayUsage ( ) ;
62- return ; // exit the application
62+ return ( - 1 ) ; // exit the application // Clintonw
6363 }
6464 else // for case-insensitive argument names, use lower-case to match
6565 {
@@ -71,7 +71,7 @@ static void Main(string[] args)
7171 {
7272 Console . WriteLine ( "The provider type must be SqlClient, ODBC, or OLEDB." ) ;
7373 displayUsage ( ) ;
74- return ;
74+ return ( - 1 ) ;
7575 }
7676 ConnectionString = cp . GetArgOrBlank ( "connect" ) ; // argument is required
7777 CommandString = cp . GetArgOrBlank ( "command" ) ; // argument is optional
@@ -80,35 +80,35 @@ static void Main(string[] args)
8080 {
8181 Console . WriteLine ( "The timeout vaue must be numeric and 0 or higher." ) ;
8282 displayUsage ( ) ;
83- return ;
83+ return ( - 1 ) ;
8484 }
8585 CursorType = cp . GetArgOrBlank ( "cursor" , "Firehose" ) . ToUpper ( ) ; // argument is optional with a default value
8686 if ( CursorType != "FIREHOSE" && CursorType != "DATASET" && CursorType != "NONE" )
8787 {
8888 Console . WriteLine ( "The cursor type must be FireHose, DataSet, or None." ) ;
8989 displayUsage ( ) ;
90- return ;
90+ return ( - 1 ) ;
9191 }
9292 value = cp . GetArgOrBlank ( "top" , "10" ) ; // argument is optional with a default value
9393 if ( int . TryParse ( value , out RowsToDisplay ) == false || RowsToDisplay < - 1 )
9494 {
9595 Console . WriteLine ( "The top vaue must be numeric and -1 or higher." ) ;
9696 displayUsage ( ) ;
97- return ;
97+ return ( - 1 ) ;
9898 }
9999 value = cp . GetArgOrBlank ( "repeat" , "1" ) ; // argument is optional with a default value
100100 if ( int . TryParse ( value , out RepeatCount ) == false || RepeatCount < 1 )
101101 {
102102 Console . WriteLine ( "The repeat vaue must be numeric and 1 or higher." ) ;
103103 displayUsage ( ) ;
104- return ;
104+ return ( - 1 ) ;
105105 }
106106 value = cp . GetArgOrBlank ( "delay" , "1" ) ; // argument is optional with a default value
107107 if ( int . TryParse ( value , out DelaySec ) == false || DelaySec < 1 )
108108 {
109109 Console . WriteLine ( "The delay vaue must be numeric and 1 or higher." ) ;
110110 displayUsage ( ) ;
111- return ;
111+ return ( - 1 ) ;
112112 }
113113 values = cp . GetArgs ( "stoponerror" ) ;
114114 if ( values . Count != 0 ) StopOnError = true ;
@@ -159,9 +159,10 @@ static void Main(string[] args)
159159 {
160160 if ( i > 0 ) System . Threading . Thread . Sleep ( DelaySec * 1000 ) ;
161161 bool success = DatabaseTest ( ) ;
162- if ( ! success && StopOnError ) break ;
162+ if ( ! success && StopOnError ) return ( - 2 ) ; // break clintonw
163163 }
164164 Console . WriteLine ( "All Tests Complete." ) ;
165+ return 0 ; // clintonw
165166 }
166167
167168 static public void displayUsage ( )
0 commit comments