private bool isJuxtaPos(string flag) { int max = -1; StrOption currLongest = null; foreach (string k in this.longFlags) { Option o = this.options.GetValueOrDefault(k, null); if (o.GetType() == typeof(StrOption)) { StrOption so = o as StrOption; int num = so.LongestJuxtaPos(flag); if (num > 0 && num > max) { max = num; currLongest = so; } } } if (currLongest != null) { currLongest.isSet = true; currLongest.AddParameter(flag.Substring(max)); return(true); } return(false); }
public void AddStrOption(IEnumerable <string> flags) { var so = new StrOption(flags: flags); longFlags.Add(so.getName()); foreach (string f in flags) { options.Add(f, so); } }
public List <string> GetOptions(string flag) { Option o = options.GetValueOrDefault(flag, null); if (o != null) { StrOption so = o as StrOption; if (so != null) { return(so.values); } } return(null); }
public string GetOption(string flag) { Option o = options.GetValueOrDefault(flag, null); if (o != null) { StrOption so = o as StrOption; if (so != null) { return(so.GetOption()); } } return(null); }