Beispiel #1
0
        public static string RedPeanutCLI(IAgentInstance agent, string module)
        {
            string input;

            if (agent == null)
            {
                PrintCLI(module);
                input = ReadLine.Read();

                if (input.Trim().Length > 0)
                {
                    ReadLine.AddHistory(input);
                }

                return(input);
            }
            else
            {
                PrintCLI(agent.AgentId, module);
                input = ReadLine.Read();
                StandardCommand cmd = new StandardCommand(agent);
                if (cmd.Execute(input))
                {
                    input = "";
                }

                if (input.Trim().Length > 0)
                {
                    ReadLine.AddHistory(input);
                }

                return(input);
            }
        }
Beispiel #2
0
        public static string RedPeanutCLI(IAgentInstance agent)
        {
            PrintCLI(agent);
            string          input = ReadLine.Read();
            StandardCommand cmd   = new StandardCommand(agent);

            if (cmd.Execute(input))
            {
                input = "";
            }

            if (input.Trim().Length > 0)
            {
                ReadLine.AddHistory(input);
            }

            return(input);
        }