diff --git a/src/WorkItemMigrator/JiraExport/JiraCommandLine.cs b/src/WorkItemMigrator/JiraExport/JiraCommandLine.cs index 129b9863..385e0aea 100644 --- a/src/WorkItemMigrator/JiraExport/JiraCommandLine.cs +++ b/src/WorkItemMigrator/JiraExport/JiraCommandLine.cs @@ -59,7 +59,7 @@ private void ConfigureCommandLineParserWithOptions() commandLineApplication.ShowHelp(); } - return succeeded ? 0 : 1; + return succeeded ? 0 : -1; }); } @@ -267,9 +267,9 @@ private static void EndSession(int itemsCount, Stopwatch sw) { "elapsed-time", string.Format("{0:hh\\:mm\\:ss}", sw.Elapsed) }}); } - public void Run() + public int Run() { - commandLineApplication.Execute(args); + return commandLineApplication.Execute(args); } } } \ No newline at end of file diff --git a/src/WorkItemMigrator/JiraExport/Program.cs b/src/WorkItemMigrator/JiraExport/Program.cs index ba749b88..a274785b 100644 --- a/src/WorkItemMigrator/JiraExport/Program.cs +++ b/src/WorkItemMigrator/JiraExport/Program.cs @@ -5,18 +5,19 @@ namespace JiraExport { static class Program { - static void Main(string[] args) + static int Main(string[] args) { VersionInfo.PrintInfoMessage("Jira Exporter"); try { var cmd = new JiraCommandLine(args); - cmd.Run(); + return cmd.Run(); } catch (Exception ex) { Logger.Log(ex, "Application stopped due to an unexpected exception", LogLevel.Critical); + return -1; } } } diff --git a/src/WorkItemMigrator/WorkItemImport/ImportCommandLine.cs b/src/WorkItemMigrator/WorkItemImport/ImportCommandLine.cs index 14be4298..3e16cb1b 100644 --- a/src/WorkItemMigrator/WorkItemImport/ImportCommandLine.cs +++ b/src/WorkItemMigrator/WorkItemImport/ImportCommandLine.cs @@ -24,9 +24,9 @@ public ImportCommandLine(params string[] args) InitCommandLine(args); } - public void Run() + public int Run() { - commandLineApplication.Execute(args); + return commandLineApplication.Execute(args); } private void InitCommandLine(params string[] args) @@ -61,7 +61,7 @@ private void ConfigureCommandLineParserWithOptions() commandLineApplication.ShowHelp(); } - return succeeded ? 0 : 1; + return succeeded ? 0 : -1; }); } diff --git a/src/WorkItemMigrator/WorkItemImport/Program.cs b/src/WorkItemMigrator/WorkItemImport/Program.cs index 6e8721b3..807c9d1d 100644 --- a/src/WorkItemMigrator/WorkItemImport/Program.cs +++ b/src/WorkItemMigrator/WorkItemImport/Program.cs @@ -13,11 +13,12 @@ static void Main(string[] args) try { var cmd = new ImportCommandLine(args); - cmd.Run(); + return cmd.Run(); } catch (Exception ex) { Logger.Log(ex, "Application stopped due to an unexpected exception", LogLevel.Critical); + return -1; } } }