예제 #1
0
 public string GetOptionOrDefault(CommandLineSwitch option)
 {
     if (!Options.TryGetValue(option, out string value))
     {
         value = option.DefaultArgument;
     }
     return(value);
 }
예제 #2
0
 public string GetOptionOrDefault(CommandLineSwitch option, string defaultValue)
 {
     if (!Options.TryGetValue(option, out string value))
     {
         value = defaultValue;
     }
     return(value);
 }
예제 #3
0
        public void AddSwitch(CommandLineSwitch @switch)
        {
            IDictionary <string, CommandLineSwitch> collection = @switch.HasArgument
                ? _options
                : _flags;

            foreach (var identifier in @switch.Identifiers)
            {
                collection[identifier] = @switch;
            }
        }