public string GetOptionOrDefault(CommandLineSwitch option) { if (!Options.TryGetValue(option, out string value)) { value = option.DefaultArgument; } return(value); }
public string GetOptionOrDefault(CommandLineSwitch option, string defaultValue) { if (!Options.TryGetValue(option, out string value)) { value = defaultValue; } return(value); }
public void AddSwitch(CommandLineSwitch @switch) { IDictionary <string, CommandLineSwitch> collection = @switch.HasArgument ? _options : _flags; foreach (var identifier in @switch.Identifiers) { collection[identifier] = @switch; } }