Parameter error checking

This commit is contained in:
2016-03-12 00:33:11 +01:00
parent de61901bb2
commit 725fb00d5a
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -34,6 +34,11 @@ namespace Ntp.Monitor.Cli
{
public static void Main(string[] args)
{
if (args.Length != 3) {
ShowUsage();
return;
}
IPAddress address;
if (!IPAddress.TryParse(args[0], out address))
@@ -62,6 +67,7 @@ namespace Ntp.Monitor.Cli
private static void ShowUsage()
{
Console.WriteLine("NTP Analyzer command query tool.");
Console.WriteLine("Usage: ntpac host port command");
}
}