Exemplo n.º 1
0
        static bool RedirectOptions(CompilerOptions options)
        {
            foreach (var item in cl.Items)
            {
                switch (item.Type)
                {
                case CommandLine.ItemType.InputFile:
                    options.Input.Add(item.Value);
                    break;

                case CommandLine.ItemType.ResponseFile:
                    options.ResponseFiles.Add(item.Value);
                    break;

                case CommandLine.ItemType.Option:
                    var opt = PFCOptions.Find(item.Name);
                    if (opt == null || opt.DotNetCompiler)
                    {
                        if (!options.SetOption(item.Name, item.Value))
                        {
                            LogError(Errors.InvalidCommandLineOption, item);
                            return(false);
                        }
                    }
                    break;
                }
            }
            return(true);
        }