mirror of
https://bitbucket.org/anguist/ntpa
synced 2026-10-02 00:05:54 +00:00
Parameter error checking
This commit is contained in:
@@ -41,12 +41,18 @@ namespace Ntp.Analyzer.Validate.Cli
|
||||
public static void Main (string[] args)
|
||||
{
|
||||
if (args.Length != 1) {
|
||||
Console.WriteLine("NTP Analyzer validator tool.");
|
||||
Console.WriteLine ("Usage: ntpav configuration");
|
||||
return;
|
||||
}
|
||||
|
||||
string configFile = args [0];
|
||||
|
||||
if (!File.Exists (configFile)) {
|
||||
Console.WriteLine("File does not exists: " + configFile);
|
||||
return;
|
||||
}
|
||||
|
||||
// Neutralize.
|
||||
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user