@@ -17,7 +17,7 @@ namespace ReCT
1717{
1818 internal static class Program
1919 {
20- private static void Main ( string [ ] args )
20+ private static int Main ( string [ ] args )
2121 {
2222 string outputPath = default ;
2323 string moduleName = default ;
@@ -60,28 +60,28 @@ private static void Main(string[] args)
6060
6161 if ( args . Length != 0 && args [ 0 ] == "create" ) {
6262 projectActions ( args ) ;
63- return ;
63+ return 0 ;
6464 }
6565
6666 if ( args . Length != 0 && args [ 0 ] == "run" ) {
6767 projectRun ( ) ;
68- return ;
68+ return 0 ;
6969 }
7070
7171 options . Parse ( args ) ;
7272
7373 if ( helpRequested )
7474 {
7575 options . WriteOptionDescriptions ( Console . Out ) ;
76- return ;
76+ return 0 ;
7777 }
7878
7979 if ( sourcePaths . Count == 0 )
8080 {
8181 Console . ForegroundColor = ConsoleColor . Red ;
8282 Console . Error . WriteLine ( "Error: need at least one source file" ) ;
8383 Console . ForegroundColor = ConsoleColor . White ;
84- return ;
84+ return - 1 ;
8585 }
8686 else
8787 Console . WriteLine ( "Source: " + sourcePaths [ 0 ] ) ;
@@ -142,7 +142,7 @@ private static void Main(string[] args)
142142 Console . Error . WriteDiagnostics ( parserDiagnostics , attachments . ToArray ( ) ) ;
143143 Console . ForegroundColor = ConsoleColor . White ;
144144 }
145- return ;
145+ return - 1 ;
146146 }
147147
148148 syntaxTrees [ pathIndex ] = syntaxTree ;
@@ -165,7 +165,7 @@ private static void Main(string[] args)
165165 {
166166 compilation . PrepareProgram ( ) ;
167167 ReturnCompilationData ( compilation ) ;
168- return ;
168+ return 0 ;
169169 }
170170
171171 ImmutableArray < Diagnostic > diagnostics = compilation . Emit ( moduleName , referencePaths . ToArray ( ) , outputPath ) ;
@@ -180,7 +180,7 @@ private static void Main(string[] args)
180180 Console . Error . WriteDiagnostics ( diagnostics , attachments . ToArray ( ) ) ;
181181 Console . ForegroundColor = ConsoleColor . White ;
182182 }
183- return ;
183+ return - 1 ;
184184 }
185185
186186 //create runtime config
@@ -235,6 +235,8 @@ private static void Main(string[] args)
235235 Console . ForegroundColor = ConsoleColor . Green ;
236236 Console . WriteLine ( "\n => Compilation Complete!" ) ;
237237 Console . ForegroundColor = ConsoleColor . White ;
238+
239+ return 0 ;
238240 }
239241
240242 static void projectRun ( )
0 commit comments