Exemple #1
0
		static void Main(string[] args) {
			options = new TProgrammOptions();
			var parser = new CommandLineParser(options);
			parser.Parse();

			CommandLineThread.start();

			if (options.help) {
				Console.WriteLine(parser.UsageInfo.GetOptionsAsString(78));
				Environment.Exit(0);
			}
			else if (parser.HasErrors) {
				Console.WriteLine(parser.UsageInfo.GetErrorsAsString(78));
				Environment.Exit(0);
			}
			else if (options.temp) {
				startTemp();
				Environment.Exit(0);
			}
			else if (options.test) {
				startTest();
				Environment.Exit(0);
			}
			else {
				startApp();
				Environment.Exit(0);
			}

		}
Exemple #2
0
		static void Main(string[] args) {

			options = new TProgrammOptions();
			var parser = new CommandLineParser(options);
			parser.Parse();

			tty = new System.IO.StreamWriter(System.IO.File.Open("/dev/tty1", FileMode.Open, FileAccess.Write), Encoding.UTF8);
			tty.AutoFlush = true;

			WriteLine("Launcher started");

			System.Diagnostics.Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High;

			var watcher = new FileSystemWatcher(Config.updatePath) { IncludeSubdirectories = true };

			watcher.Changed += (a, b) => {
				startUpdate();
			};

			watcher.EnableRaisingEvents = true;

			start();

			Console.CancelKeyPress += (a, b) => {
				restart = false;
				stop();
			};

			//Thread.CurrentThread.Suspend();
			while (true) {
				var line = Console.ReadLine();
				try {
					process.StandardInput.WriteLine(line);
				}
				catch { }
			}
		}