public void Exceptions() { if(sPlatform.IsWindows) return; OptionSet p = new OptionSet() { { "a=", v => { /* ignore */ } }, }; OptionContext c = new OptionContext(p); Utils.AssertException(typeof(InvalidOperationException), "OptionContext.Option is null.", c, v => { string ignore = v.OptionValues[0]; }); c.Option = p[0]; Utils.AssertException(typeof(ArgumentOutOfRangeException), "Argument is out of range.\nParameter name: index", c, v => { string ignore = v.OptionValues[2]; }); c.OptionName = "-a"; Utils.AssertException(typeof(OptionException), "Missing required value for option '-a'.", c, v => { string ignore = v.OptionValues[0]; }); }
protected override void OnParseComplete(OptionContext c) { throw new NotImplementedException(); }
protected override void OnParseComplete(OptionContext c) { throw new NotSupportedException("Category.OnParseComplete should not be invoked."); }
protected override void OnParseComplete(OptionContext c) { action(c.OptionValues); }