Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure return code is returned from the application. Use error code -1 #880

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/WorkItemMigrator/JiraExport/JiraCommandLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private void ConfigureCommandLineParserWithOptions()
commandLineApplication.ShowHelp();
}

return succeeded ? 0 : 1;
return succeeded ? 0 : -1;
});
}

Expand Down Expand Up @@ -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);
}
}
}
5 changes: 3 additions & 2 deletions src/WorkItemMigrator/JiraExport/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/WorkItemMigrator/WorkItemImport/ImportCommandLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -61,7 +61,7 @@ private void ConfigureCommandLineParserWithOptions()
commandLineApplication.ShowHelp();
}

return succeeded ? 0 : 1;
return succeeded ? 0 : -1;
});
}

Expand Down
3 changes: 2 additions & 1 deletion src/WorkItemMigrator/WorkItemImport/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down