Пример #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("NEO Developer Shell - " + DebuggerUtils.DebuggerVersion);
            var settings = new DebuggerSettings(Directory.GetCurrentDirectory());
            var shell    = new DebuggerShell(settings);

            shell.AddCommand(new ExitCommand());

            if (args.Length > 0)
            {
                shell.Execute("load " + args[0], OutputMessage);
            }

            while (true)
            {
                Console.Write(">");
                var input = Console.ReadLine();

                if (string.IsNullOrEmpty(input))
                {
                    continue;
                }

                if (!shell.Execute(input, OutputMessage))
                {
                    Console.WriteLine("Unknown command. Type HELP for list of commands.");
                }
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("NEO Developer Shell - " + DebuggerUtils.DebuggerVersion);
            var settings = new DebuggerSettings(Directory.GetCurrentDirectory());
            var debugger = new DebugManager(settings);
            var shell    = new DebuggerShell(debugger);

            shell.AddCommand(new ExitCommand());

            if (args.Length > 0)
            {
                var input = args[0].Replace("'", "\"");
                if (input.StartsWith("\"") && input.EndsWith("\""))
                {
                    input = input.Substring(1, input.Length - 2);
                }

                var lines = input.Split(';');
                foreach (var line in lines)
                {
                    if (!string.IsNullOrEmpty(line))
                    {
                        Console.WriteLine(line);
                        shell.Execute(line, OutputMessage);
                    }
                }
            }

            while (true)
            {
                Console.ForegroundColor = ConsoleColor.Gray;
                Console.Write(">");
                var input = Console.ReadLine();

                if (string.IsNullOrEmpty(input))
                {
                    continue;
                }

                if (!shell.Execute(input, OutputMessage))
                {
                    Console.WriteLine("Unknown command. Type HELP for list of commands.");
                }
            }
        }