Rename NucuCarSensorsCommandLine.cs to SensorsCommandLine.cs

This commit is contained in:
Denis-Cosmin Nutiu 2019-11-17 16:52:43 +02:00
parent 451c3ee664
commit 3ce31ebf64
2 changed files with 7 additions and 7 deletions

View file

@ -1,16 +1,16 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using CommandLine; using CommandLine;
using static NucuCar.TestClient.NucuCarSensorsCommandLine; using static NucuCar.TestClient.SensorsCommandLine;
namespace NucuCar.TestClient namespace NucuCar.TestClient
{ {
class Program internal class Program
{ {
// ReSharper disable once ArrangeTypeMemberModifiers // ReSharper disable once ArrangeTypeMemberModifiers
static void Main(string[] args) static void Main(string[] args)
{ {
Parser.Default.ParseArguments<NucuCarSensorsCommandLineOptions>(args) Parser.Default.ParseArguments<SensorsCommandLineOptions>(args)
.WithParsed(opts => { RunSensorsTestCommand(opts).GetAwaiter().GetResult(); }) .WithParsed(opts => { RunSensorsTestCommand(opts).GetAwaiter().GetResult(); })
.WithNotParsed(HandleParseError); .WithNotParsed(HandleParseError);
} }

View file

@ -9,20 +9,20 @@ using NucuCarSensorsProto;
namespace NucuCar.TestClient namespace NucuCar.TestClient
{ {
[Verb("sensors", HelpText = "Test the gRPC sensors services.")] [Verb("sensors", HelpText = "Test the gRPC sensors services.")]
public class NucuCarSensorsCommandLineOptions public class SensorsCommandLineOptions
{ {
[Option('u', "url", Required = false, HelpText = "The url and port of the gRPC server.", [Option('u', "url", Required = false, HelpText = "The url and port of the gRPC server.",
Default = "https://localhost:8000")] Default = "https://localhost:8000")]
public string GrpcServiceAddress { get; set; } public string GrpcServiceAddress { get; set; }
} }
public class NucuCarSensorsCommandLine public class SensorsCommandLine
{ {
public string GrpcServiceAddress { get; set; } public string GrpcServiceAddress { get; set; }
public static async Task RunSensorsTestCommand(NucuCarSensorsCommandLineOptions options) public static async Task RunSensorsTestCommand(SensorsCommandLineOptions options)
{ {
var sensorsCommandLine = new NucuCarSensorsCommandLine(); var sensorsCommandLine = new SensorsCommandLine();
sensorsCommandLine.GrpcServiceAddress = options.GrpcServiceAddress; sensorsCommandLine.GrpcServiceAddress = options.GrpcServiceAddress;
await sensorsCommandLine.EnvironmentSensorGrpcServiceTest(); await sensorsCommandLine.EnvironmentSensorGrpcServiceTest();