@@ -17,7 +17,7 @@ namespace ReCT
17
17
{
18
18
internal static class Program
19
19
{
20
- private static void Main ( string [ ] args )
20
+ private static int Main ( string [ ] args )
21
21
{
22
22
string outputPath = default ;
23
23
string moduleName = default ;
@@ -60,28 +60,28 @@ private static void Main(string[] args)
60
60
61
61
if ( args . Length != 0 && args [ 0 ] == "create" ) {
62
62
projectActions ( args ) ;
63
- return ;
63
+ return 0 ;
64
64
}
65
65
66
66
if ( args . Length != 0 && args [ 0 ] == "run" ) {
67
67
projectRun ( ) ;
68
- return ;
68
+ return 0 ;
69
69
}
70
70
71
71
options . Parse ( args ) ;
72
72
73
73
if ( helpRequested )
74
74
{
75
75
options . WriteOptionDescriptions ( Console . Out ) ;
76
- return ;
76
+ return 0 ;
77
77
}
78
78
79
79
if ( sourcePaths . Count == 0 )
80
80
{
81
81
Console . ForegroundColor = ConsoleColor . Red ;
82
82
Console . Error . WriteLine ( "Error: need at least one source file" ) ;
83
83
Console . ForegroundColor = ConsoleColor . White ;
84
- return ;
84
+ return - 1 ;
85
85
}
86
86
else
87
87
Console . WriteLine ( "Source: " + sourcePaths [ 0 ] ) ;
@@ -142,7 +142,7 @@ private static void Main(string[] args)
142
142
Console . Error . WriteDiagnostics ( parserDiagnostics , attachments . ToArray ( ) ) ;
143
143
Console . ForegroundColor = ConsoleColor . White ;
144
144
}
145
- return ;
145
+ return - 1 ;
146
146
}
147
147
148
148
syntaxTrees [ pathIndex ] = syntaxTree ;
@@ -165,7 +165,7 @@ private static void Main(string[] args)
165
165
{
166
166
compilation . PrepareProgram ( ) ;
167
167
ReturnCompilationData ( compilation ) ;
168
- return ;
168
+ return 0 ;
169
169
}
170
170
171
171
ImmutableArray < Diagnostic > diagnostics = compilation . Emit ( moduleName , referencePaths . ToArray ( ) , outputPath ) ;
@@ -180,7 +180,7 @@ private static void Main(string[] args)
180
180
Console . Error . WriteDiagnostics ( diagnostics , attachments . ToArray ( ) ) ;
181
181
Console . ForegroundColor = ConsoleColor . White ;
182
182
}
183
- return ;
183
+ return - 1 ;
184
184
}
185
185
186
186
//create runtime config
@@ -235,6 +235,8 @@ private static void Main(string[] args)
235
235
Console . ForegroundColor = ConsoleColor . Green ;
236
236
Console . WriteLine ( "\n => Compilation Complete!" ) ;
237
237
Console . ForegroundColor = ConsoleColor . White ;
238
+
239
+ return 0 ;
238
240
}
239
241
240
242
static void projectRun ( )
0 commit comments