Example #1
0
        static int RunProcessor(string[] args)
        {
            foreach (string arg in args)
            {
                if (arg == "process") continue;
                else if (arg.StartsWith("--pipe-in=")) options.pipeIn = arg.Remove(0, "--pipe-in=".Length);
                else if (arg.StartsWith("--pipe-out=")) options.pipeOut = arg.Remove(0, "--pipe-out=".Length);
                else return InvalidOption(arg);
            }

            if (string.IsNullOrEmpty(options.pipeIn)) return OptionIsRequired("--pipe-in");
            if (string.IsNullOrEmpty(options.pipeOut)) return OptionIsRequired("--pipe-out");

            Echo host = new Echo(options);
            host.Run();
            return 0;
        }