예제 #1
0
        private void RunTokenisedCommandBuffer(CommandInterpreter interpreter)
        {
            ShellContext ctx = new ShellContext(this);

            foreach (var token in interpreter.ParsedTokens)
            {
                token.Execute(ctx);
                WriteSeparator();
            }
        }
예제 #2
0
        public void Execute(ShellContext ctx)
        {
            string cmd = m_args[0];

            m_args.RemoveAt(0);

            if (ctx.Environment.BuiltInCommandExists(cmd))
            {
                ctx.Environment.ExecBuiltInCommand(cmd, m_args.ToArray());
            }
            else
            {
                var path = ctx.Environment.FindApplicationInPath(cmd);
                if (string.IsNullOrEmpty(path))
                {
                    ShellEnvironment.WriteErrorLine($"{cmd} is not a built-in command and could not be found on the PATH or in the current directory.");
                }
                else
                {
                    ctx.Environment.RunProgram(cmd, m_args.ToArray());
                }
            }
        }
예제 #3
0
 public void Execute(ShellContext ctx)
 {
 }