23 using System.Globalization;
31 namespace Ntp.Analyzer.Cli
37 public static void Main(
string[] args)
39 Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
41 string tempDir = Directory.GetCurrentDirectory();
42 string configFile = null;
43 string pidFile = null;
50 {
"h|?|help", v => { ShowUsage(); }},
51 {
"daemon=", v => { name = v; }},
52 {
"config=", v => { configFile = v; }},
53 {
"writepid=", v => { pidFile = v; }},
54 {
"temp=", v => { tempDir = v; }}
57 var rem = p.Parse(args).ToArray();
66 initlog.WriteLine(
"Unknown option: " + rem[0],
Severity.Error);
70 if (configFile == null)
72 initlog.WriteLine(
"Please specify configuration file with option --config",
Severity.Error);
81 var main =
new Main(configFile, pid, pidFile, name, initlog);
86 initlog.WriteLine(
"Unexpected error: " + e.Message,
Severity.Error);
87 initlog.WriteLine(e.StackTrace,
Severity.Error);
93 Console.WriteLine(
"NTP Analyzer v0.8.2");
94 Console.WriteLine(
"Usage: ntpa --config file [--temp dir] [--writepid file] [--daemon name]");
static void Main(string[] args)
static LogBase CreateSysLog(string name)
static string WorkingDirectory
static LogGroup CreateErrorLog(string name)