Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
almost got everything working now with help texts and whatnot
- Loading branch information
1 parent
e3a431f
commit bf31e1b
Showing
8 changed files
with
239 additions
and
15 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,19 @@ | ||
using System; | ||
|
||
namespace GoCommando | ||
{ | ||
/// <summary> | ||
/// Apply this attribute to a property of a command class (which is also decorated with <see cref="ParameterAttribute"/>) in | ||
/// order to provide a description of the parameter | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Property)] | ||
public class DescriptionAttribute : Attribute | ||
{ | ||
public string DescriptionText { get; } | ||
|
||
public DescriptionAttribute(string descriptionText) | ||
{ | ||
DescriptionText = descriptionText; | ||
} | ||
} | ||
} |
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,18 @@ | ||
using System; | ||
|
||
namespace GoCommando | ||
{ | ||
/// <summary> | ||
/// Apply one or more of these to a command property to show examples on how this particular parameter can be used | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)] | ||
public class ExampleAttribute : Attribute | ||
{ | ||
public string ExampleValue { get; } | ||
|
||
public ExampleAttribute(string exampleValue) | ||
{ | ||
ExampleValue = exampleValue; | ||
} | ||
} | ||
} |
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,23 @@ | ||
using System; | ||
using System.Runtime.Serialization; | ||
|
||
namespace GoCommando | ||
{ | ||
/// <summary> | ||
/// Exception that can be used to exit the program with a custom exit code | ||
/// </summary> | ||
[Serializable] | ||
public class CustomExitCodeException : Exception | ||
{ | ||
protected CustomExitCodeException(SerializationInfo info, StreamingContext context) : base(info, context) | ||
{ | ||
} | ||
|
||
public CustomExitCodeException(int exitCode, string message) : base(message) | ||
{ | ||
ExitCode = exitCode; | ||
} | ||
|
||
public int ExitCode { get; } | ||
} | ||
} |
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
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
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
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
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