private void ParseOption(OptionGroup opt, string[] args, string arg, Info info, bool canarg, string argument, ref int idx) { if (info.ValueType == typeof(bool)) { info.Set(opt, true); } else if (canarg && (argument != null || idx < args.Length && !args[idx].StartsWith("-"))) { if (argument == null) { argument = args[idx]; ++idx; } info.Set(opt, argument); } else if (info.Option.OptionalArgument) { info.Set(opt, info.Option.DefaultArgument); } else { throw new OptionException("Expected value for option `{0}'...", arg); } }
public void Remove(OptionGroup grp) { d_groups.Remove(grp); }
public void Add(OptionGroup grp) { d_groups.Add(grp); }