StripLeadingAndTrailingQuotes() static private method

static private StripLeadingAndTrailingQuotes ( String str ) : String
str String
return String
Ejemplo n.º 1
0
        private void ProcessArguments(IOptions options, OptionValue opt, string[] tokens, ref int index)
        {
            // loop until an option is found
            while (++index < tokens.Length)
            {
                String str = tokens[index];

                // found an Option, not an argument
                if (options.HasOption(str) && str.StartsWith("-"))
                {
                    index--;
                    break;
                }

                // found a value
                try {
                    opt.AddValueForProcessing(Util.StripLeadingAndTrailingQuotes(str));
                } catch (ApplicationException) {
                    index--;
                    break;
                }
            }

            if (opt.Values == null && !opt.Option.HasOptionalArguments())
            {
                throw new MissingArgumentException(opt.Option);
            }
        }