-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from Ellerbach/improve-table-check
Improvement for DocLinkChecker
- Loading branch information
Showing
3 changed files
with
209 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Licensed to DocFX Companion Tools and contributors under one or more agreements. | ||
// DocFX Companion Tools and contributors licenses this file to you under the MIT license. | ||
|
||
namespace DocLinkChecker.Helpers | ||
{ | ||
using System; | ||
|
||
/// <summary> | ||
/// Helper methods to set the exit code. | ||
/// </summary> | ||
public static class ExitCodeHelper | ||
{ | ||
private static int exitCode; | ||
|
||
/// <summary> | ||
/// Possible exit codes. | ||
/// </summary> | ||
public enum ExitCodes | ||
{ | ||
/// <summary> | ||
/// Exit code for seccessful execution. | ||
/// </summary> | ||
OK = 0, | ||
|
||
/// <summary> | ||
/// Exit code for parsing error. | ||
/// </summary> | ||
ParsingError = 1, | ||
|
||
/// <summary> | ||
/// Exit code for incorrect table format detected. | ||
/// </summary> | ||
TableFormatError = 2, | ||
|
||
/// <summary> | ||
/// Exit code for unkonown exception. | ||
/// </summary> | ||
UnknownExceptionError = 999, | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets default exit code. | ||
/// </summary> | ||
public static ExitCodes ExitCode | ||
{ | ||
get | ||
{ | ||
return (ExitCodes)exitCode; | ||
} | ||
|
||
set | ||
{ | ||
if (Enum.IsDefined(typeof(ExitCodes), value)) | ||
{ | ||
exitCode = (int)value; | ||
} | ||
else | ||
{ | ||
exitCode = (int)ExitCodes.UnknownExceptionError; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.