-
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 #40 from davewalker5/add-cli-help
Added command line help
- Loading branch information
Showing
32 changed files
with
425 additions
and
260 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
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
{ | ||
public enum CommandLineOptionType | ||
{ | ||
Help, | ||
MinimumLogLevel, | ||
Host, | ||
Port, | ||
|
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
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
13 changes: 13 additions & 0 deletions
13
src/BaseStationReader.Entities/Interfaces/ICommandLineParser.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,13 @@ | ||
using BaseStationReader.Entities.Config; | ||
|
||
namespace BaseStationReader.Entities.Interfaces | ||
{ | ||
public interface ICommandLineParser | ||
{ | ||
void Add(CommandLineOptionType optionType, bool mandatory, string name, string shortName, string description, int minimumNumberOfValues, int maximumNumberOfValues); | ||
List<string>? GetValues(CommandLineOptionType optionType); | ||
void Help(); | ||
bool IsPresent(CommandLineOptionType optionType); | ||
void Parse(IEnumerable<string> args); | ||
} | ||
} |
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,9 @@ | ||
using BaseStationReader.Entities.Config; | ||
|
||
namespace BaseStationReader.Entities.Interfaces | ||
{ | ||
public interface IHelpGenerator | ||
{ | ||
void Generate(IEnumerable<CommandLineOption> options); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/BaseStationReader.Entities/Interfaces/ISimulatorSettingsBuilder.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,10 @@ | ||
using BaseStationReader.Entities.Config; | ||
using BaseStationReader.Entities.Interfaces; | ||
|
||
namespace BaseStationReader.Entities.Interfaces | ||
{ | ||
public interface ISimulatorSettingsBuilder | ||
{ | ||
SimulatorApplicationSettings? BuildSettings(ICommandLineParser parser, string configJsonPath); | ||
} | ||
} |
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
19 changes: 19 additions & 0 deletions
19
src/BaseStationReader.Logic/Configuration/SimulatorCommandLineParser.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,19 @@ | ||
using BaseStationReader.Entities.Config; | ||
using BaseStationReader.Entities.Interfaces; | ||
|
||
namespace BaseStationReader.Logic.Configuration | ||
{ | ||
public class SimulatorCommandLineParser : CommandLineParser | ||
{ | ||
public SimulatorCommandLineParser(IHelpGenerator? generator) : base(generator) | ||
{ | ||
Add(CommandLineOptionType.Help, false, "--help", "-h", "Show command line help",0, 0); | ||
Add(CommandLineOptionType.Port, false, "--port", "-p", "Port to send data on", 1, 1); | ||
Add(CommandLineOptionType.SendInterval, false, "--send-interval", "-s", "Message send interval (ms)", 1, 1); | ||
Add(CommandLineOptionType.NumberOfAircraft, false, "--number", "-n", "Number of concurrent simulated aircraft", 1, 1); | ||
Add(CommandLineOptionType.Lifespan, false, "--lifespan", "-ls", "Simulated aircraft lifespan (ms)", 1, 1); | ||
Add(CommandLineOptionType.LogFile, false, "--log-file", "-l", "Log file path and name", 1, 1); | ||
Add(CommandLineOptionType.MinimumLogLevel, false, "--log-level", "-ll", "Minimum logging level (Debug, Info, Warning or Error)", 1, 1); | ||
} | ||
} | ||
} |
Oops, something went wrong.