Minor improvements

This commit is contained in:
2016-03-19 22:55:38 +01:00
parent e66f069d0a
commit 0db48ed940
24 changed files with 181 additions and 34 deletions
@@ -8,7 +8,6 @@
<ProjectGuid>{9790FACF-170E-43C7-889A-D4445FC7E7A1}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Ntp.Analyzer.Validate.Cli</RootNamespace>
<AssemblyName>ntpav</AssemblyName>
<ReleaseVersion>0.3</ReleaseVersion>
<StartupObject>Ntp.Analyzer.Validate.Cli.Program</StartupObject>
</PropertyGroup>
@@ -22,6 +21,7 @@
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
<Commandlineparameters>~/code/ntpa/example/ntpa.stat.conf</Commandlineparameters>
<AssemblyName>ntpav</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
@@ -30,6 +30,13 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
<AssemblyName>ntpav</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Server|AnyCPU' ">
<Optimize>false</Optimize>
<OutputPath>bin\Server</OutputPath>
<WarningLevel>4</WarningLevel>
<AssemblyName>Ntp.Analyzer.Validate.Cli</AssemblyName>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
+21 -8
View File
@@ -40,24 +40,31 @@ 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");
// Neutralize.
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
if (args.Length == 0 || args.Length > 2) {
ShowUsage ();
return;
}
if (args.Length == 1 && args[0] == "help") {
ShowUsage ();
return;
}
string configFile = args [0];
// Neutralize.
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
Configuration config = LoadConfig (configFile);
if (config == null) {
return;
}
Console.WriteLine ("Parsed config ...");
Console.WriteLine (config);
if (args.Length == 2 && args [1] == "verbose") {
Console.WriteLine (config);
}
TestFilesystem (config);
@@ -122,5 +129,11 @@ namespace Ntp.Analyzer.Validate.Cli
Console.WriteLine (ex.Message);
}
}
private static void ShowUsage()
{
Console.WriteLine ("NTP Analyzer validator tool.");
Console.WriteLine ("Usage: ntpav configuration [verbose]");
}
}
}
}