-
Notifications
You must be signed in to change notification settings - Fork 0
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 davewalker5/BSR-24-Add-CLI-Arguments-Parser
Added command line parser for specifying arguments
- Loading branch information
Showing
17 changed files
with
523 additions
and
32 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
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
16 changes: 16 additions & 0 deletions
16
src/BaseStationReader.Entities/Config/CommandLineOption.cs
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,16 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace BaseStationReader.Entities.Config | ||
{ | ||
[ExcludeFromCodeCoverage] | ||
public class CommandLineOption | ||
{ | ||
public CommandLineOptionType OptionType { get; set; } | ||
public bool Mandatory { get; set; } = false; | ||
public string Name { get; set; } = ""; | ||
public string ShortName { get; set; } = ""; | ||
public string Description { get; set; } = ""; | ||
public int MinimumNumberOfValues { get; set; } = 1; | ||
public int MaximumNumberOfValues { get; set; } = 1; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/BaseStationReader.Entities/Config/CommandLineOptionType.cs
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,15 @@ | ||
namespace BaseStationReader.Entities.Config | ||
{ | ||
public enum CommandLineOptionType | ||
{ | ||
Host, | ||
Port, | ||
TimeToRecent, | ||
TimeToStale, | ||
TimeToRemoval, | ||
LogFile, | ||
EnableSqlWriter, | ||
WriterInterval, | ||
WriterBatchSize | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/BaseStationReader.Entities/Config/CommandLineOptionValue.cs
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,11 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace BaseStationReader.Entities.Config | ||
{ | ||
[ExcludeFromCodeCoverage] | ||
public class CommandLineOptionValue | ||
{ | ||
public CommandLineOption? Option { get; set; } | ||
public List<string> Values { get; private set; } = new List<string>(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/BaseStationReader.Entities/Exceptions/MalformedCommandLineException.cs
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,31 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Runtime.Serialization; | ||
|
||
namespace BaseStationReader.Entities.Exceptions | ||
{ | ||
[Serializable] | ||
[ExcludeFromCodeCoverage] | ||
public class MalformedCommandLineException : Exception | ||
{ | ||
public MalformedCommandLineException() | ||
{ | ||
} | ||
|
||
public MalformedCommandLineException(string message) : base(message) | ||
{ | ||
} | ||
|
||
public MalformedCommandLineException(string message, Exception inner) : base(message, inner) | ||
{ | ||
} | ||
|
||
protected MalformedCommandLineException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext) | ||
{ | ||
} | ||
|
||
public override void GetObjectData(SerializationInfo info, StreamingContext context) | ||
{ | ||
base.GetObjectData(info, context); | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/BaseStationReader.Entities/Exceptions/MissingMandatoryOptionException.cs
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,31 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Runtime.Serialization; | ||
|
||
namespace BaseStationReader.Entities.Exceptions | ||
{ | ||
[Serializable] | ||
[ExcludeFromCodeCoverage] | ||
public class MissingMandatoryOptionException : Exception | ||
{ | ||
public MissingMandatoryOptionException() | ||
{ | ||
} | ||
|
||
public MissingMandatoryOptionException(string message) : base(message) | ||
{ | ||
} | ||
|
||
public MissingMandatoryOptionException(string message, Exception inner) : base(message, inner) | ||
{ | ||
} | ||
|
||
protected MissingMandatoryOptionException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext) | ||
{ | ||
} | ||
|
||
public override void GetObjectData(SerializationInfo info, StreamingContext context) | ||
{ | ||
base.GetObjectData(info, context); | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/BaseStationReader.Entities/Exceptions/TooFewValuesException.cs
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,31 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Runtime.Serialization; | ||
|
||
namespace BaseStationReader.Entities.Exceptions | ||
{ | ||
[Serializable] | ||
[ExcludeFromCodeCoverage] | ||
public class TooFewValuesException : Exception | ||
{ | ||
public TooFewValuesException() | ||
{ | ||
} | ||
|
||
public TooFewValuesException(string message) : base(message) | ||
{ | ||
} | ||
|
||
public TooFewValuesException(string message, Exception inner) : base(message, inner) | ||
{ | ||
} | ||
|
||
protected TooFewValuesException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext) | ||
{ | ||
} | ||
|
||
public override void GetObjectData(SerializationInfo info, StreamingContext context) | ||
{ | ||
base.GetObjectData(info, context); | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/BaseStationReader.Entities/Exceptions/TooManyValuesException.cs
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,36 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Linq; | ||
using System.Runtime.Serialization; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace BaseStationReader.Entities.Exceptions | ||
{ | ||
[Serializable] | ||
[ExcludeFromCodeCoverage] | ||
public class TooManyValuesException : Exception | ||
{ | ||
public TooManyValuesException() | ||
{ | ||
} | ||
|
||
public TooManyValuesException(string message) : base(message) | ||
{ | ||
} | ||
|
||
public TooManyValuesException(string message, Exception inner) : base(message, inner) | ||
{ | ||
} | ||
|
||
protected TooManyValuesException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext) | ||
{ | ||
} | ||
|
||
public override void GetObjectData(SerializationInfo info, StreamingContext context) | ||
{ | ||
base.GetObjectData(info, context); | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/BaseStationReader.Entities/Exceptions/UnrecognisedCommandLineOptionException.cs
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,31 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Runtime.Serialization; | ||
|
||
namespace BaseStationReader.Entities.Exceptions | ||
{ | ||
[Serializable] | ||
[ExcludeFromCodeCoverage] | ||
public class UnrecognisedCommandLineOptionException : Exception | ||
{ | ||
public UnrecognisedCommandLineOptionException() | ||
{ | ||
} | ||
|
||
public UnrecognisedCommandLineOptionException(string message) : base(message) | ||
{ | ||
} | ||
|
||
public UnrecognisedCommandLineOptionException(string message, Exception inner) : base(message, inner) | ||
{ | ||
} | ||
|
||
protected UnrecognisedCommandLineOptionException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext) | ||
{ | ||
} | ||
|
||
public override void GetObjectData(SerializationInfo info, StreamingContext context) | ||
{ | ||
base.GetObjectData(info, context); | ||
} | ||
} | ||
} |
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.