1 <Type Name="Option" FullName="Mono.Options.Option">
2 <TypeSignature Language="C#" Value="public abstract class Option" />
3 <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit Option extends System.Object" />
5 <AssemblyName>Mono.Options</AssemblyName>
6 <AssemblyVersion>0.2.0.0</AssemblyVersion>
7 <AssemblyVersion>0.2.1.0</AssemblyVersion>
8 <AssemblyVersion>0.2.2.0</AssemblyVersion>
9 <AssemblyVersion>0.2.3.0</AssemblyVersion>
11 <ThreadingSafetyStatement>
12 All members of this type are safe for multithreaded operations.
13 Subclasses must be thread-safe if multithreaded invocation of
14 <see cref="M:Mono.Options.OptionSet.Parse(System.Collections.Generic.IEnumerable<System.String>)" />
16 </ThreadingSafetyStatement>
18 <BaseTypeName>System.Object</BaseTypeName>
23 Represents information about an option.
27 Instances of <see cref="T:Mono.Options.Option" /> are created via
28 the various <see cref="M:Mono.Options.OptionSet.Add" /> overloads,
34 <see cref="M:Mono.Options.OptionSet.Add(System.String,System.Action{System.String})" />
39 <see cref="M:Mono.Options.OptionSet.Add(System.String,System.String,System.Action{System.String})" />
44 <see cref="M:Mono.Options.OptionSet.Add(System.String,Mono.Options.OptionAction{System.String,System.String})" />
49 <see cref="M:Mono.Options.OptionSet.Add(System.String,System.String,Mono.Options.OptionAction{System.String,System.String})" />
54 <see cref="M:Mono.Options.OptionSet.Add``1(System.String,System.Action{``0})" />
59 <see cref="M:Mono.Options.OptionSet.Add``1(System.String,System.String,System.Action{``0})" />
64 <see cref="M:Mono.Options.OptionSet.Add``2(System.String,Mono.Options.OptionAction{``0,``1})" />
69 <see cref="M:Mono.Options.OptionSet.Add``2(System.String,System.String,Mono.Options.OptionAction{``0,``1})" />
74 You can also add custom <see cref="T:Mono.Options.Option" />
75 subclasses to an <see cref="T:Mono.Options.OptionSet" /> via the
76 <see cref="M:Mono.Options.OptionSet.Add(Mono.Options.Option)" />
79 <block subset="none" type="overrides">
80 Inheritors of this type must override the <see langword="abstract" /> method
81 <see cref="M:Mono.Options.Option.OnParseComplete(Mono.Options.OptionContext)" />,
82 which is (indirectly) invoked from within
83 <see cref="M:Mono.Options.OptionSet.Parse(System.String,Mono.Options.OptionContext)" />
84 when an option matching one of the <paramref name="prototype" />
85 aliases is encountered.
90 <Member MemberName=".ctor">
91 <MemberSignature Language="C#" Value="protected Option (string prototype, string description);" />
92 <MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(string prototype, string description) cil managed" />
93 <MemberType>Constructor</MemberType>
95 <AssemblyVersion>0.2.0.0</AssemblyVersion>
96 <AssemblyVersion>0.2.1.0</AssemblyVersion>
97 <AssemblyVersion>0.2.2.0</AssemblyVersion>
98 <AssemblyVersion>0.2.3.0</AssemblyVersion>
101 <Parameter Name="prototype" Type="System.String" />
102 <Parameter Name="description" Type="System.String" />
105 <param name="prototype">
106 A <see cref="T:System.String" /> containing a <c>|</c>-separated
107 list of option names (aliases) and an optional value-type specifier.
109 <param name="description">
110 A <see cref="T:System.String" /> containing documentation for the
114 Creates and initializes a new instance of the
115 <see cref="T:Mono.Options.Option" /> class.
119 This constructor initializes the
120 <see cref="P:Mono.Options.Option.Prototype" /> property of the
121 new instance using <paramref name="prototype" />, the
122 <see cref="P:Mono.Options.Option.Description" /> property of the
123 new instance using <paramref name="description" />. and
124 initializes the <see cref="P:Mono.Options.Option.MaxValueCount" />
125 property of the new instance to <c>1</c>.
128 This is equivalent to calling the
129 <see cref="C:Mono.Options.Option(System.String,System.String,System.Int32)" />
130 constructor as with <c>Option(<paramref name="prototype" />,
131 <paramref name="description" />, 1)</c>.
134 <exception cref="T:System.ArgumentException">
136 <paramref name="prototype" /> is the empty string <c>""</c>.
140 <paramref name="prototype" /> contains an empty alias, such as
145 Conflicting <see cref="T:Mono.Options.OptionValueType" /> values
146 were found within <paramref name="prototype" />.
150 <paramref name="prototype" /> only includes the default handler
151 <c><></c> and <paramref name="prototype" /> did not specify an
152 <see cref="T:Mono.Options.OptionValueType" /> value of
153 <see cref="F:Mono.Options.OptionValueType.None" />.
156 <exception cref="T:System.ArgumentNullException">
157 <paramref name="prototype" /> is <see langword="null" />.
161 <Member MemberName=".ctor">
162 <MemberSignature Language="C#" Value="protected Option (string prototype, string description, int maxValueCount);" />
163 <MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(string prototype, string description, int32 maxValueCount) cil managed" />
164 <MemberType>Constructor</MemberType>
166 <AssemblyVersion>0.2.0.0</AssemblyVersion>
167 <AssemblyVersion>0.2.1.0</AssemblyVersion>
168 <AssemblyVersion>0.2.2.0</AssemblyVersion>
169 <AssemblyVersion>0.2.3.0</AssemblyVersion>
172 <Parameter Name="prototype" Type="System.String" />
173 <Parameter Name="description" Type="System.String" />
174 <Parameter Name="maxValueCount" Type="System.Int32" />
177 <param name="prototype">
178 A <see cref="T:System.String" /> containing a <c>|</c>-separated
179 list of option names (aliases) and an optional value-type specifier.
181 <param name="description">
182 A <see cref="T:System.String" /> containing documentation for the
185 <param name="maxValueCount">
186 A <see cref="T:System.Int32" /> containing the number of values this
190 Creates and initializes a new instance of the
191 <see cref="T:Mono.Options.Option" /> class.
195 This constructor initializes the
196 <see cref="P:Mono.Options.Option.Prototype" /> property of the
197 new instance using <paramref name="prototype" />, the
198 <see cref="P:Mono.Options.Option.Description" /> property of the
199 new instance using <paramref name="description" />. and
200 initializes the <see cref="P:Mono.Options.Option.MaxValueCount" />
201 property of the new instance using <paramref name="maxValueCount" />.
204 <paramref name="prototype" /> is a <c>|</c>-separated list of
205 option names. It should be listed in shortest-to-longest order,
206 e.g. <c>h|help</c>. <paramref name="prototype" /> may contain a
207 <see cref="T:Mono.Options.OptionValueType" /> specifier following
208 one of the <c>|</c>-separated entries, and a value separator list
209 following the <see cref="T:Mono.Options.OptionValueType" />
213 The <see cref="P:Mono.Options.Option.OptionValueType" /> property
214 is initialized based on whether a <c>=</c> or <c>:</c> follows one
215 of the aliases within <paramref name="prototype" />.
217 <see cref="F:Mono.Options.OptionValueType.Required" /> value,
218 while <c>:</c> specifies an
219 <see cref="F:Mono.Options.OptionValueType.Optional" /> value.
220 If neither <c>=</c> nor <c>:</c> is not specified, then
221 <see cref="F:Mono.Options.OptionValueType.None" /> is used.
222 The value specifier may be used anywhere within
223 <paramref name="prototype" />, so <c>n|name=</c>, <c>n=|name</c>
224 and <c>n=|name=</c> are equivalent, but you cannot mix types;
225 <c>n:|name=</c> is invalid.
228 A default handler may be specified by using <c><></c> as the
229 option name. The default handler is invoked for any unhandled
231 <see cref="M:Mono.Options.OptionSet.Parse(System.Collections.Generic.IEnumerable{System.String})" />;
232 consequently, if a default handler is provided then
233 <see cref="M:Mono.Options.OptionSet.Parse(System.Collections.Generic.IEnumerable{System.String})" />
235 <see cref="T:System.Collections.Generic.List{System.String}" />.
238 The default handler may either be provided as a stand-alone
239 <see cref="T:Mono.Options.Option" />, in which case it may not
240 specify a <see cref="T:Mono.Options.OptionValueType" /> other
241 than <see cref="F:Mono.Options.OptionValueType.None" />.
242 Alternatively, it may be an alias, in which case the
243 <see cref="T:Mono.Options.Option" /> must accept an
244 <see cref="F:Mono.Options.OptionValueType.Optional" /> or
245 <see cref="F:Mono.Options.OptionValueType.Required" /> value, and
246 <paramref name="maxValueCount" /> must be <c>1</c>.
249 Multiple values may be bundled together, such as
250 <c>-opt key=value</c>. The value separator list specifies which
251 characters can be used to split the value argument to generate
252 separate values. The value separator list is available when
253 <paramref name="maxValueCount" /> is greater than <c>1</c>, and
254 and an <see cref="T:Mono.Options.OptionValueType" /> was
255 specified. The value separator list follows the <c>=</c> or
256 <c>:</c> and is one of the following:
262 A sequence of character enclosed by <c>{</c> and <c>}</c>.
263 Multiple such sequences may be specified by listing the
264 <c>{...}</c> sequence multiple times.
267 The sequence <c>{}</c> requires that each value be a different
268 argument, and no argument splitting will be performed.
269 This sequence has no effect if other separators are also
270 listed (as separate arguments are always permitted for
271 <see cref="F:Mono.Options.OptionValueType.Required" />
278 Any literal character other than <c>{</c> and <c>}</c>.
283 If the separator list is not provided, then <c>=:</c> is the
284 default separator list.
287 For example, the prototype <c>"A:+-*/"</c> would permit any of
288 `<c>+</c>', `<c>-</c>', `<c>*</c>', or `<c>/</c>' to be used to
289 split an argument into values, so <c>-A:5/2</c> would generate the
290 sequence of values <c>5</c> and <c>2</c> for the option <c>-A</c>.
291 Furthermore, the prototype <c>"A={-->}{=>}"</c> would permit
292 either the string <c>--></c> or the string <c>=></c> to be used,
293 so <c>-A A->B C</c> woud parse <c>A->B</c> as one value and
294 <c>C</c> as the other value, while <c>-A A-->B C</c> would parse
295 <c>A</c> as one value and <c>B</c> as the other value while
296 <c>C</c> would be unhandled (unless the option required 3 values,
297 in which case <c>C</c> would be the 3rd value).
300 <exception cref="T:System.ArgumentException">
302 <paramref name="prototype" /> is the empty string <c>""</c>.
306 <paramref name="prototype" /> contains an empty alias, such as
311 Conflicting <see cref="T:Mono.Options.OptionValueType" /> values
312 were found within <paramref name="prototype" />.
316 <paramref name="maxValueCount" /> is <c>0</c> and
317 <paramref name="prototype" /> specified an
318 <see cref="T:Mono.Options.OptionValueType" /> value of
319 <see cref="F:Mono.Options.OptionValueType.Optional" /> or
320 <see cref="F:Mono.Options.OptionValueType.Required" />.
324 <paramref name="maxValueCount" /> is greater than <c>1</c> and
325 <paramref name="prototype" /> specified an
326 <see cref="T:Mono.Options.OptionValueType" /> value of
327 <see cref="F:Mono.Options.OptionValueType.None" />.
331 <paramref name="prototype" /> contains a separator list and
332 <paramref name="maxValueCount" /> is <c>0</c> or <c>1</c>.
336 <paramref name="prototype" /> contains a badly formatted
337 separator list, such as <c>{{</c>, <c>}}</c>, <c>{{}</c>, etc.
341 <paramref name="prototype" /> only includes the default handler
342 <c><></c> and <paramref name="prototype" /> did not specify an
343 <see cref="T:Mono.Options.OptionValueType" /> value of
344 <see cref="F:Mono.Options.OptionValueType.None" />.
348 <paramref name="prototype" /> includes the default handler
349 <c><></c>, and <paramref name="MaxValueCount" /> is greater
353 <exception cref="T:System.ArgumentNullException">
354 <paramref name="prototype" /> is <see langword="null" />.
358 <Member MemberName="Description">
359 <MemberSignature Language="C#" Value="public string Description { get; }" />
360 <MemberSignature Language="ILAsm" Value=".property instance string Description" />
361 <MemberType>Property</MemberType>
363 <AssemblyVersion>0.2.0.0</AssemblyVersion>
364 <AssemblyVersion>0.2.1.0</AssemblyVersion>
365 <AssemblyVersion>0.2.2.0</AssemblyVersion>
366 <AssemblyVersion>0.2.3.0</AssemblyVersion>
369 <ReturnType>System.String</ReturnType>
373 A <see cref="T:System.String" /> containing documentation for this
377 A <see cref="T:System.String" /> containing documentation for this
381 This property is used to generate documentation within
382 <see cref="M:Mono.Options.OptionSet.WriteOptionDescriptions(System.IO.TextWriter)" />.
383 The string returned is translated via the
384 <paramref name="localizer" /> parameter provided to the
385 <see cref="C:Mono.Options.OptionSet(System.Converter{System.String,System.String})" />
386 constructor before being written to the
387 <see cref="T:System.IO.TextWriter" /> instance.
389 <altmember cref="M:Mono.Options.OptionSet.WriteOptionDescriptions(System.IO.TextWriter)" />
392 <Member MemberName="GetNames">
393 <MemberSignature Language="C#" Value="public string[] GetNames ();" />
394 <MemberSignature Language="ILAsm" Value=".method public hidebysig instance string[] GetNames() cil managed" />
395 <MemberType>Method</MemberType>
397 <AssemblyVersion>0.2.0.0</AssemblyVersion>
398 <AssemblyVersion>0.2.1.0</AssemblyVersion>
399 <AssemblyVersion>0.2.2.0</AssemblyVersion>
400 <AssemblyVersion>0.2.3.0</AssemblyVersion>
403 <ReturnType>System.String[]</ReturnType>
407 <summary>Retrieves all name aliases that make up
408 <see cref="P:Mono.Options.Option.Prototype" />.</summary>
410 A <see cref="T:System.String" /> array containing all name aliases
411 for this <see cref="T:Mono.Options.Option" /> instance.
414 The returned option names will not contain any
415 <see cref="T:Mono.Options.OptionValueType" /> specifier that may be
416 within <see cref="P:Mono.Options.Option.Prototype" />.
417 If <see cref="P:Mono.Options.Option.Prototype" /> is
418 <c>a=|b=|c=</c>, the array returned will contain <c>a</c>, <c>b</c>,
423 <Member MemberName="GetValueSeparators">
424 <MemberSignature Language="C#" Value="public string[] GetValueSeparators ();" />
425 <MemberSignature Language="ILAsm" Value=".method public hidebysig instance string[] GetValueSeparators() cil managed" />
426 <MemberType>Method</MemberType>
428 <AssemblyVersion>0.2.0.0</AssemblyVersion>
429 <AssemblyVersion>0.2.1.0</AssemblyVersion>
430 <AssemblyVersion>0.2.2.0</AssemblyVersion>
431 <AssemblyVersion>0.2.3.0</AssemblyVersion>
434 <ReturnType>System.String[]</ReturnType>
439 Retreives all value separators, strings which are used to split an
440 argument into one or more values for the this
441 <see cref="T:Mono.Options.Option" />.
444 A <see cref="T:System.String" /> array containing all strings that
445 should be used when splitting an argument into one or more values
446 for this <see cref="T:Mono.Options.Option" />.
450 Value separators may be provided within
451 <see cref="P:Mono.Options.Option.Prototype" /> only if:
456 <see cref="P:Mono.Options.Option.MaxValueCount" /> is greater than 1.
461 <see cref="P:Mono.Options.Option.OptionValueType" /> is
462 <see cref="F:Mono.Options.OptionValueType.Optional" /> or
463 <see cref="F:Mono.Options.OptionValueType.Required" />.
469 <see cref="C:Mono.Options.Option(System.String,System.String,System.Int32)" />
470 constructor for more information.
475 <Member MemberName="Invoke">
476 <MemberSignature Language="C#" Value="public void Invoke (Mono.Options.OptionContext c);" />
477 <MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Invoke(class Mono.Options.OptionContext c) cil managed" />
478 <MemberType>Method</MemberType>
480 <AssemblyVersion>0.2.0.0</AssemblyVersion>
481 <AssemblyVersion>0.2.1.0</AssemblyVersion>
482 <AssemblyVersion>0.2.2.0</AssemblyVersion>
483 <AssemblyVersion>0.2.3.0</AssemblyVersion>
486 <ReturnType>System.Void</ReturnType>
489 <Parameter Name="c" Type="Mono.Options.OptionContext" />
493 An <see cref="T:Mono.Options.OptionContext" /> instance containing
494 information about the option that was parsed.
498 <see cref="M:Mono.Options.Option.OnParseComplete(Mono.Options.OptionContext)" />
499 then clears out <paramref name="c" />.
503 This method is invoked from within
504 <see cref="M:Mono.Options.OptionSet.Parse(System.String,Mono.Options.OptionContext)" />
505 when an option with a name from
506 <see cref="M:Mono.Options.Option.GetNames" /> is encountered and
507 matches the required number of values governed by
508 <see cref="P:Mono.Options.Option.OptionValueType" /> and
509 <see cref="P:Mono.Options.Option.MaxValueCount" />.
511 <block subset="none" type="behaviors">
514 <see cref="M:Mono.Options.Option.OnParseComplete(Mono.Options.OptionContext)" />,
515 passing along <paramref name="c" /> unchanged, and then sets the
516 <see cref="P:Mono.Options.OptionContext.Option" /> and
517 <see cref="P:Mono.Options.OptionContext.OptionName" />
518 properties to <see langword="null" />, and
519 <see cref="M:Mono.Options.OptionValueCollection.Clear" />s out
520 <see cref="P:Mono.Options.OptionContext.OptionValues" />.
524 <altmember cref="M:Mono.Options.Option.OnParseComplete(Mono.Options.OptionContext)" />
525 <altmember cref="M:Mono.Options.OptionSet.Parse(System.String,Mono.Options.OptionContext)" />
526 <altmember cref="M:Mono.Options.OptionSet.Parse(System.Collections.Generic.IEnumerable{System.String})" />
529 <Member MemberName="MaxValueCount">
530 <MemberSignature Language="C#" Value="public int MaxValueCount { get; }" />
531 <MemberSignature Language="ILAsm" Value=".property instance int32 MaxValueCount" />
532 <MemberType>Property</MemberType>
534 <AssemblyVersion>0.2.0.0</AssemblyVersion>
535 <AssemblyVersion>0.2.1.0</AssemblyVersion>
536 <AssemblyVersion>0.2.2.0</AssemblyVersion>
537 <AssemblyVersion>0.2.3.0</AssemblyVersion>
540 <ReturnType>System.Int32</ReturnType>
544 A <see cref="T:System.Int32" /> containing the maximum number of
545 values this <see cref="T:Mono.Options.Option" /> accepts.
548 A <see cref="T:System.Int32" /> containing the maximum number of
549 values this <see cref="T:Mono.Options.Option" /> accepts.
553 This is a maximum, and may not be the number of values present
554 within <see cref="P:Mono.Options.OptionContext.OptionValues" />
556 <see cref="M:Mono.Options.Option.OnParseComplete(Mono.Options.OptionContext)" />
557 is invoked. There will be
558 <see cref="P:Mono.Options.Option.MaxValueCount" /> values if
559 <see cref="P:Mono.Options.Option.OptionValueType" /> is
560 <see cref="F:Mono.Options.OptionValueType.Required" />, but if
561 <see cref="P:Mono.Options.Option.OptionValueType" /> is
562 <see cref="F:Mono.Options.OptionValueType.Optional" /> then
563 <see cref="P:Mono.Options.OptionContext.OptionValues" /> may
569 <Member MemberName="OnParseComplete">
570 <MemberSignature Language="C#" Value="protected abstract void OnParseComplete (Mono.Options.OptionContext c);" />
571 <MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnParseComplete(class Mono.Options.OptionContext c) cil managed" />
572 <MemberType>Method</MemberType>
574 <AssemblyVersion>0.2.0.0</AssemblyVersion>
575 <AssemblyVersion>0.2.1.0</AssemblyVersion>
576 <AssemblyVersion>0.2.2.0</AssemblyVersion>
577 <AssemblyVersion>0.2.3.0</AssemblyVersion>
580 <ReturnType>System.Void</ReturnType>
583 <Parameter Name="c" Type="Mono.Options.OptionContext" />
587 An <see cref="T:Mono.Options.OptionContext" /> instance containing
588 information about the option that was parsed.
591 Perform an action when an option is parsed.
595 This method must be overridden by all subclasses, within which the
596 subclass can perform some custom per-option processing.
599 This method is invoked from within
600 <see cref="M:Mono.Options.OptionSet.Parse(System.String,Mono.Options.OptionContext)" />
601 when an option with a name from
602 <see cref="M:Mono.Options.Option.GetNames" /> is encountered and
603 matches the required number of values governed by
604 <see cref="P:Mono.Options.Option.OptionValueType" /> and
605 <see cref="P:Mono.Options.Option.MaxValueCount" />.
610 The following example has a custom
611 <see cref="T:Mono.Options.Option" /> subclass which overrides
612 <see cref="M:Mono.Options.Option.OnParseComplete(Mono.Options.OptionContext)" />:
614 <code lang="C#" src="examples/subclass.cs">// Case-Insensitive and Concatenating OptionSet
616 using System.Collections.Generic;
619 class DemoOptionSet : OptionSet {
620 protected override void InsertItem (int index, Option item)
622 if (item.Prototype.ToLower () != item.Prototype)
623 throw new ArgumentException ("prototypes must be lower-case!");
624 base.InsertItem (index, item);
627 protected override OptionContext CreateOptionContext ()
629 return new OptionContext (this);
632 protected override bool Parse (string option, OptionContext c)
635 bool haveParts = GetOptionParts (option, out f, out n, out s, out v);
636 Option nextOption = null;
637 string newOption = option;
640 string nl = n.ToLower ();
641 nextOption = Contains (nl) ? this [nl] : null;
642 newOption = f + n.ToLower () + (v != null ? s + v : "");
645 if (c.Option != null) {
647 if (c.Option != null && haveParts) {
648 if (nextOption == null) {
652 throw new OptionException (
653 string.Format ("Found option `{0}' as value for option `{1}'.",
654 option, c.OptionName), c.OptionName);
657 // have a option w/ required value; try to concat values.
658 if (AppendValue (option, c)) {
659 if (!option.EndsWith ("\\") &&
660 c.Option.MaxValueCount == c.OptionValues.Count) {
666 base.Parse (newOption, c);
669 if (!haveParts || v == null) {
670 // Not an option; let base handle as a non-option argument.
671 return base.Parse (newOption, c);
674 if (nextOption.OptionValueType != OptionValueType.None &&
676 c.Option = nextOption;
677 c.OptionValues.Add (v);
678 c.OptionName = f + n;
682 return base.Parse (newOption, c);
685 private bool AppendValue (string value, OptionContext c)
688 string[] seps = c.Option.GetValueSeparators ();
689 foreach (var o in seps.Length != 0
690 ? value.Split (seps, StringSplitOptions.None)
691 : new string[]{value}) {
692 int idx = c.OptionValues.Count-1;
693 if (idx == -1 || !c.OptionValues [idx].EndsWith ("\\")) {
694 c.OptionValues.Add (o);
698 c.OptionValues [idx] += value;
707 public static void Main (string[] args)
709 List<string> names = new List<string> ();
710 Dictionary<string,string> map = new Dictionary<string,string> ();
713 OptionSet p = new DemoOptionSet () {
714 { "n|name=", v => names.Add (v) },
715 { "r|repeat:", (int v) => repeat = v },
716 { "m|map=", (k,v) => map.Add (k, v) },
719 List<string> extra;
721 extra = p.Parse (args);
723 catch (OptionException e) {
724 Console.Write ("subclass: ");
725 Console.WriteLine (e.Message);
730 if (extra.Count > 0) {
731 message = string.Join (" ", extra.ToArray ());
734 message = "Hello {0}!";
737 foreach (string name in names) {
738 for (int i = 0; i < repeat; ++i)
739 Console.WriteLine (message, name);
741 List<string> keys = new List<string>(map.Keys);
743 foreach (string key in keys) {
744 Console.WriteLine ("Key: {0}={1}", key, map [key]);
751 See <see cref="T:Mono.Options.OptionSet" /> for more on this
755 <altmember cref="M:Mono.Options.Option.Invoke(Mono.Options.OptionContext)" />
758 <Member MemberName="OptionValueType">
759 <MemberSignature Language="C#" Value="public Mono.Options.OptionValueType OptionValueType { get; }" />
760 <MemberSignature Language="ILAsm" Value=".property instance valuetype Mono.Options.OptionValueType OptionValueType" />
761 <MemberType>Property</MemberType>
763 <AssemblyVersion>0.2.0.0</AssemblyVersion>
764 <AssemblyVersion>0.2.1.0</AssemblyVersion>
765 <AssemblyVersion>0.2.2.0</AssemblyVersion>
766 <AssemblyVersion>0.2.3.0</AssemblyVersion>
769 <ReturnType>Mono.Options.OptionValueType</ReturnType>
773 An <see cref="T:Mono.Options.OptionValueType" /> instance
774 specifying whether this <see cref="T:Mono.Options.Option" /> takes
775 a value, and if so, whether it's required or optional.
778 An <see cref="T:Mono.Options.OptionValueType" /> specifying whether
779 a value is required for this value.
783 This is initialized based on the presence of <c>=</c> or
784 <c>:</c> within <see cref="P:Mono.Options.Option.Prototype" />.
789 <Member MemberName="Parse<T>">
790 <MemberSignature Language="C#" Value="protected static T Parse<T> (string value, Mono.Options.OptionContext c);" />
791 <MemberSignature Language="ILAsm" Value=".method familystatic hidebysig !!T Parse<T>(string value, class Mono.Options.OptionContext c) cil managed" />
792 <MemberType>Method</MemberType>
794 <AssemblyVersion>0.2.0.0</AssemblyVersion>
795 <AssemblyVersion>0.2.1.0</AssemblyVersion>
796 <AssemblyVersion>0.2.2.0</AssemblyVersion>
797 <AssemblyVersion>0.2.3.0</AssemblyVersion>
800 <ReturnType>T</ReturnType>
803 <TypeParameter Name="T" />
806 <Parameter Name="value" Type="System.String" />
807 <Parameter Name="c" Type="Mono.Options.OptionContext" />
811 The type to convert the string <paramref name="value" /> to.
814 A <see cref="T:System.String" /> containing a representation of the
815 type <typeparamref name="T" /> that should be converted into an
816 instance of type <typeparamref name="T" />.
819 A <see cref="T:Mono.Options.OptionContext" /> containing additional
820 contextual information needed error handling.
823 Converts the <see cref="T:System.String" /><paramref name="value" />
824 into an object of type <typeparamref name="T" />.
827 If <paramref name="value" /> is <see langword="null" />, then
828 <see langword="default(T)" /> is returned. Otherwise,
829 <paramref name="value" /> is converted to a value of type
830 <typeparamref name="T" />.
834 <see cref="M:System.ComponentModel.TypeDescriptor.GetConverter" />
836 <see cref="T:System.ComponentModel.TypeConverter" /> associated
837 with type <typeparamref name="T" />, and
838 <see cref="M:System.ComponentModel.TypeConverter.ConvertFromString" />
839 is used to convert <paramref name="value" /> into a
840 <typeparamref name="T" />.
843 <exception cref="T:Mono.Options.OptionException">
844 If <paramref name="value" /> is not <see langword="null" /> and
845 <see cref="M:System.ComponentModel.TypeConverter.ConvertFromString" />
846 generated an exception while trying to convert
847 <paramref name="value" />.
851 <Member MemberName="Prototype">
852 <MemberSignature Language="C#" Value="public string Prototype { get; }" />
853 <MemberSignature Language="ILAsm" Value=".property instance string Prototype" />
854 <MemberType>Property</MemberType>
856 <AssemblyVersion>0.2.0.0</AssemblyVersion>
857 <AssemblyVersion>0.2.1.0</AssemblyVersion>
858 <AssemblyVersion>0.2.2.0</AssemblyVersion>
859 <AssemblyVersion>0.2.3.0</AssemblyVersion>
862 <ReturnType>System.String</ReturnType>
866 The <see cref="T:Mono.Options.Option" /> prototype, containing
867 option name aliases and the option value requirements.
870 A <see cref="T:System.String" /> containing the prototype of this
871 <see cref="T:Mono.Options.Option" /> instance.
875 The prototype contains a <c>|</c>-separated list of all option name
876 aliases and a value specifier of <c>=</c> for required values and
877 <c>:</c> for optional values; if neither <c>=</c> nor <c>:</c> is
878 present, no value is taken.
881 If a value specifier is present, then a value separator list may
882 also be present after the value specifier.
887 <Member MemberName="ToString">
888 <MemberSignature Language="C#" Value="public override string ToString ();" />
889 <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance string ToString() cil managed" />
890 <MemberType>Method</MemberType>
892 <AssemblyVersion>0.2.0.0</AssemblyVersion>
893 <AssemblyVersion>0.2.1.0</AssemblyVersion>
894 <AssemblyVersion>0.2.2.0</AssemblyVersion>
895 <AssemblyVersion>0.2.3.0</AssemblyVersion>
898 <ReturnType>System.String</ReturnType>
903 Returns <see cref="P:Mono.Options.Option.Prototype" />.
906 A <see cref="T:System.String" /> containing
907 <see cref="P:Mono.Options.Option.Prototype" />.