Beispiel #1
0
        void ParseArguments(IList<string> commandLineArguments) {
            var argumentParser = new ArgumentParser();
            argumentParser.AddArgumentHandler("a", value => memory.GetItem<AppDomainSetup>().ConfigurationFile = value);
            argumentParser.AddArgumentHandler("c", value => new SuiteConfiguration(memory).LoadXml(folderModel.GetPageContent(value)));
            argumentParser.AddArgumentHandler("r", value => memory.GetItem<Settings>().Runner = value);
            argumentParser.SetUnusedHandler(value => extraArguments.Add(value));
            argumentParser.Parse(commandLineArguments);

        }
Beispiel #2
0
        void ParseArguments(Memory memory, IList<string> arguments) {
            if (arguments.Count == 0) {
                return;
            }
            var argumentParser = new ArgumentParser();
            argumentParser.AddSwitchHandler("d", () => memory.GetItem<Settings>().DryRun = true);
            argumentParser.AddArgumentHandler("i", value => memory.GetItem<Settings>().InputFolder = value);
            argumentParser.AddArgumentHandler("o", value => memory.GetItem<Settings>().OutputFolder = value);
            argumentParser.AddArgumentHandler("s", value => selectedFile = value);
            argumentParser.AddArgumentHandler("x", value => memory.GetItem<FileExclusions>().AddRange(value.Split(';')));
            argumentParser.AddArgumentHandler("t", value => memory.GetItem<Settings>().TagList = value);

            argumentParser.Parse(arguments);
            if (memory.GetItem<Settings>().InputFolder == null)
                throw new FormatException("Missing input folder");
            if (memory.GetItem<Settings>().OutputFolder == null)
                throw new FormatException("Missing output folder");
        }
Beispiel #3
0
 public void SetUp(string[] commandLineArguments) {
     var argumentParser = new ArgumentParser();
     argumentParser.AddArgumentHandler("c", value => new SuiteConfiguration(memory).LoadXml(new FileSystemModel().GetPageContent(value)));
     argumentParser.Parse(commandLineArguments);
 }
 [SetUp] public void SetUp() {
     parser = new ArgumentParser();
     itemsInvoked = new List<string>();
 }