diff --git a/AutoRest/AutoRest/AutoRest.csproj b/AutoRest/AutoRest/AutoRest.csproj
index 8bd5ec84e9..7c578e0980 100644
--- a/AutoRest/AutoRest/AutoRest.csproj
+++ b/AutoRest/AutoRest/AutoRest.csproj
@@ -31,6 +31,7 @@
Properties\AssemblyVersionInfo.cs
+
@@ -70,4 +71,4 @@
-
+
\ No newline at end of file
diff --git a/AutoRest/AutoRest/ExitCode.cs b/AutoRest/AutoRest/ExitCode.cs
new file mode 100644
index 0000000000..fe09a82b44
--- /dev/null
+++ b/AutoRest/AutoRest/ExitCode.cs
@@ -0,0 +1,14 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+
+namespace Microsoft.Rest.Generator.Cli
+{
+ ///
+ /// Available exit codes.
+ ///
+ public enum ExitCode : int
+ {
+ Success = 0,
+ Error = 1
+ }
+}
diff --git a/AutoRest/AutoRest/Program.cs b/AutoRest/AutoRest/Program.cs
index b0c4aa7abe..f7bdf406b1 100644
--- a/AutoRest/AutoRest/Program.cs
+++ b/AutoRest/AutoRest/Program.cs
@@ -12,8 +12,10 @@ namespace Microsoft.Rest.Generator.Cli
{
internal class Program
{
- private static void Main(string[] args)
+ private static int Main(string[] args)
{
+ int exitCode = (int)ExitCode.Error;
+
try
{
Settings settings = null;
@@ -69,6 +71,7 @@ private static void Main(string[] args)
{
Console.WriteLine(Resources.GenerationComplete,
settings.CodeGenerator, settings.Input);
+ exitCode = (int)ExitCode.Success;
}
}
@@ -91,6 +94,7 @@ private static void Main(string[] args)
Console.Error.WriteLine(Resources.ConsoleErrorMessage, exception.Message);
Console.Error.WriteLine(Resources.ConsoleErrorStackTrace, exception.StackTrace);
}
+ return exitCode;
}
///