public void Run(string[] args) { Opt = new Options(); if (args.Length == 0) { Exit(String.Empty, null); } int argsNotUsed = CommandLineParser.ParseArguments(args, Opt); if (argsNotUsed == -1) { Exit("Error parsing options", null); } string[] args2 = new string[argsNotUsed]; for (int i = 0; i < argsNotUsed; i++) { args2[i] = args[args.Length - argsNotUsed + i]; } if (Opt.AmDaemon && !Opt.AmSender) { Daemon.DaemonMain(Opt); return; } var cInfo = new ClientInfo { Options = Opt }; StartClient(args2, cInfo); Opt.DoStats = true; cInfo.IoStream = null; Report(cInfo); Console.Write("Press 'Enter' to exit."); Console.Read(); }
public void Run(string[] args) { opt = new Options(); opt.Init(); if (args.Length == 0) { Usage(); MainClass.Exit(String.Empty, null); } int argsNotUsed = CommandLineParser.ParseArguments(args, opt); if (argsNotUsed == -1) { MainClass.Exit("Error parsing options", null); } string[] args2 = new string[argsNotUsed]; for (int i = 0; i < argsNotUsed; i++) { args2[i] = args[args.Length - argsNotUsed + i]; } if (opt.amDaemon && !opt.amSender) { Daemon.DaemonMain(opt); return; } ClientInfo cInfo = new ClientInfo(); cInfo.Options = opt; StartClient(args2, cInfo); opt.doStats = true; cInfo.IoStream = null; Report(cInfo); Console.Write("Press 'Enter' to exit."); Console.Read(); }