Exemplo n.º 1
0
    private static void ParseOverrideConfig(Arguments arguments, string[] values)
    {
        if (values == null || values.Length == 0)
        {
            return;
        }

        var parser = new OverrideConfigOptionParser();

        // key=value
        foreach (var keyValueOption in values)
        {
            var keyAndValue = QuotedStringHelpers.SplitUnquoted(keyValueOption, '=');
            if (keyAndValue.Length != 2)
            {
                throw new WarningException($"Could not parse /overrideconfig option: {keyValueOption}. Ensure it is in format 'key=value'.");
            }

            var optionKey = keyAndValue[0].ToLowerInvariant();
            if (!OverrideConfigOptionParser.SupportedProperties.Contains(optionKey))
            {
                throw new WarningException($"Could not parse /overrideconfig option: {keyValueOption}. Unsuported 'key'.");
            }
            else
            {
                parser.SetValue(optionKey, keyAndValue[1]);
            }
        }
        arguments.OverrideConfig = parser.GetConfig();
    }
Exemplo n.º 2
0
    public Arguments ParseArguments(string commandLineArguments)
    {
        var arguments = QuotedStringHelpers.SplitUnquoted(commandLineArguments, ' ');

        return(ParseArguments(arguments));
    }
Exemplo n.º 3
0
 public string[] SplitUnquotedTests(string input, char splitChar)
 {
     return(QuotedStringHelpers.SplitUnquoted(input, splitChar));
 }
Exemplo n.º 4
0
 public string[] SplitUnquotedRemovesEmptyEntries(string input, char splitChar)
 {
     return(QuotedStringHelpers.SplitUnquoted(input, splitChar));
 }
Exemplo n.º 5
0
 public string[] SplitUnquotedTests(string input, char splitChar) => QuotedStringHelpers.SplitUnquoted(input, splitChar);