Пример #1
0
        public static void Main(string[] args)
        {
            Console.WriteLine("ReadLine Library Demo");
            Console.WriteLine("---------------------");
            Console.WriteLine();

            string[] history =
            {
                "ls -a",
                "dotnet run",
                "git init"
            };

            IReadLine readLine = ReadLine.Instance;

            readLine.AddHistory(history);

            readLine.AutoCompletionHandler = new AutoCompletionHandler();

            var input = readLine.Read("(prompt)> ");

            Console.WriteLine(input);

            input = readLine.ReadPassword("Enter Password> ");
            Console.WriteLine(input);
        }
Пример #2
0
        public ShellStream(IWriteLine writer, IReadLine reader)
        {
            var thread = Thread.CurrentThread.Name;

            this.writer = writer;
            this.reader = reader;
            runner      = new Runner(new Runner.Args()
            {
                ThreadName = string.Format("{0}_SHELL_R", thread)
            });
            runner.Run(ReadLoop);
            runner.Run(AfterLoop);
        }