Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,245 @@
<Type Name="ArgumentSource" FullName="Mono.Options.ArgumentSource">
<TypeSignature Language="C#" Value="public abstract class ArgumentSource" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit ArgumentSource extends System.Object" />
<AssemblyInfo>
<AssemblyName>Mono.Options</AssemblyName>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>
Support for inserting additional arguments during
<see cref="M:Mono.Options.OptionSet.Parse(System.Collections.Generic.IEnumerable{System.String})" />
processing.
</summary>
<remarks>
<para>
The <see cref="T:Mono.Options.ArgumentSource" /> type is an
abstraction to allow "insertion" of additional values for option
processing while processing arguments.
</para>
<para>
The principal use case is for <i>response files</i>, as used by
<c>CSC.EXE</c>, <c>CL.EXE</c>, and numerous other
compilers. A response file contains additional options for the tool,
and the contents of the response file should be "inserted" as if
entered on the command line. Response files are useful for bypassing
command-line length limitations, among other things.
</para>
<para>
Applications must opt-in to response file support by calling
<see cref="M:Mono.Options.OptionSet.Add(Mono.Options.ArgumentSource)" />
before calling
<see cref="M:Mono.Options.OptionSet.Parse(System.Collections.Generic.IEnumerable{System.String})" />.
</para>
<block subset="none" type="overrides">
Inheriting classes must override the following abstract methods:
<list type="bullet"><item><term><see cref="M:Mono.Options.ArgumentSource.GetNames" /></term></item><item><term><see cref="P:Mono.Options.ArgumentSource.Description" /></term></item><item><term><see cref="M:Mono.Options.ArgumentSource.GetArguments(System.Int32, System.Collections.Generic.IEnumerable{System.String}@)" /></term></item></list></block>
</remarks>
<altmember cref="T:Mono.Options.ResponseFileSource" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected ArgumentSource ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>
Construct and initialize a
<see cref="T:Mono.Options.ArgumentSource" /> instance.
</summary>
<remarks>
</remarks>
</Docs>
</Member>
<Member MemberName="Description">
<MemberSignature Language="C#" Value="public abstract string Description { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Description" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>
The description to provide for the argument source within
<see cref="M:Mono.Options.OptionSet.WriteOptionDescriptions(System.IO.TextWriter)" />.
</summary>
<value>
A <see cref="T:System.String" /> containing
the description to provide for the argument source within
<see cref="M:Mono.Options.OptionSet.WriteOptionDescriptions(System.IO.TextWriter)" />.
</value>
<remarks>
</remarks>
</Docs>
</Member>
<Member MemberName="GetArguments">
<MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable&lt;string&gt; GetArguments (System.IO.TextReader reader);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1&lt;string&gt; GetArguments(class System.IO.TextReader reader) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.Generic.IEnumerable&lt;System.String&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="reader" Type="System.IO.TextReader" />
</Parameters>
<Docs>
<param name="reader">
A <see cref="T:System.IO.TextReader" /> to extract arguments from.
</param>
<summary>
Extract arguments from a <see cref="T:System.IO.TextReader" />.
</summary>
<returns>
A <see cref="T:System.Collections.Generic.IEnumerable{System.String}" />
which will provide arguments extracted from <paramref name="reader" />.
</returns>
<remarks>
<para>
Arguments are extracted from <paramref name="reader" /> by
splitting on newlines and spaces but maintaining the contents of
single-quoted and double-quoted strings. Thus, <c>A B</c> will be
split as the separate strings <c>"A", "B"</c>, while
<c>"A B"</c> will be returned as-is.
</para>
<block subset="none" type="note">
<paramref name="reader" /> is not
<see cref="M:System.IO&gt;TextReader.Close" />d.
</block>
</remarks>
</Docs>
</Member>
<Member MemberName="GetArguments">
<MemberSignature Language="C#" Value="public abstract bool GetArguments (string value, out System.Collections.Generic.IEnumerable&lt;string&gt; replacement);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool GetArguments(string value, class System.Collections.Generic.IEnumerable`1&lt;string&gt; replacement) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.String" />
<Parameter Name="replacement" Type="System.Collections.Generic.IEnumerable&lt;System.String&gt;&amp;" RefType="out" />
</Parameters>
<Docs>
<param name="value">
A <see cref="T:System.String" /> containing the argument to replace
with additional arguments.
</param>
<param name="replacement">
A <see cref="T:System.Collections.Generic.IEnumerable{System.String}" />
which will refer to teh replacement arguments if this method returns
<see langword="true" />; otherwise, this value should be ignored by
callers.
</param>
<summary>
Replace the argument <paramref name="value" /> with a set of
replacement arguments.
</summary>
<returns>
<see langword="true" /> if this
<see cref="T:Mono.Options.ArgumentSource" /> will replace
<paramref name="value" /> with a set of replacement strings and
<paramref name="replacement" /> contains the replacement strings;
otherwise, <see langword="false" />.
</returns>
<remarks>
<para>
Before
<see cref="M:Mono.Options.OptionSet.Parse(System.Collections.Generic.IEnumerable{System.String})" />
attempts to parse an argument as an option (or option value), all
registered <see cref="T:Mono.Options.OptionSet.ArgumentSources" />
are consulted in registration order to see if
<see cref="T:Mono.Options.ArgumentSource" /> "supports" the
argument via
<see cref="M:Mono.Options.ArgumentSource.GetArguments(System.Int32, System.Collections.Generic.IEnumerable{System.String}@)" />.
The first <c>ArgumentSource</c> to return <see langword="true" />
from <c>GetArguments()</c> may provide the replacement tokens, and
no later <c>ArgumentSource</c>es are consulted.
</para>
</remarks>
<altmember cref="M:Mono.Options.OptionSet.Parse(System.Collections.Generic.IEnumerable{System.String})" />
</Docs>
</Member>
<Member MemberName="GetArgumentsFromFile">
<MemberSignature Language="C#" Value="public static System.Collections.Generic.IEnumerable&lt;string&gt; GetArgumentsFromFile (string file);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Collections.Generic.IEnumerable`1&lt;string&gt; GetArgumentsFromFile(string file) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.Generic.IEnumerable&lt;System.String&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="file" Type="System.String" />
</Parameters>
<Docs>
<param name="file">
A <see cref="T:System.String" /> containing the file to extract
arguments from.
</param>
<summary>
Extract arguments from the specified filename.
</summary>
<returns>
A <see cref="T:System.Collections.Generic.IEnumerable{System.String}" />
which will provide arguments extracted from <paramref name="file" />.
</returns>
<remarks>
</remarks>
<exception cref="T:System.IO.IOException">
<paramref name="file" /> could not be read.
</exception>
<altmember cref="M:Mono.Options.ArgumentSource.GetArguments(System.IO.TextReader)" />
</Docs>
</Member>
<Member MemberName="GetNames">
<MemberSignature Language="C#" Value="public abstract string[] GetNames ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance string[] GetNames() cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String[]</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>
The names to provide for the argument source within
<see cref="M:Mono.Options.OptionSet.WriteOptionDescriptions(System.IO.TextWriter)" />.
</summary>
<returns>
A <see cref="T:System.String" /> array containing
the names to provide for the argument source within
<see cref="M:Mono.Options.OptionSet.WriteOptionDescriptions(System.IO.TextWriter)" />.
</returns>
<remarks>
</remarks>
</Docs>
</Member>
</Members>
</Type>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,63 @@
<Type Name="OptionAction&lt;TKey,TValue&gt;" FullName="Mono.Options.OptionAction&lt;TKey,TValue&gt;">
<TypeSignature Language="C#" Value="public delegate void OptionAction&lt;TKey,TValue&gt;(TKey key, TValue value);" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed OptionAction`2&lt;TKey, TValue&gt; extends System.MulticastDelegate" />
<AssemblyInfo>
<AssemblyName>Mono.Options</AssemblyName>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<TypeParameters>
<TypeParameter Name="TKey" />
<TypeParameter Name="TValue" />
</TypeParameters>
<Base>
<BaseTypeName>System.Delegate</BaseTypeName>
</Base>
<Parameters>
<Parameter Name="key" Type="TKey" />
<Parameter Name="value" Type="TValue" />
</Parameters>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Docs>
<typeparam name="TKey">The first parameter type.</typeparam>
<typeparam name="TValue">The second parameter type.</typeparam>
<param name="key">A value of type <typeparamref name="TKey" />.</param>
<param name="value">A value of type <typeparamref name="TValue" />.</param>
<summary>
A delegate that can refer to any method taking two arguments and
returning <see cref="T:System.Void" />.
</summary>
<remarks>
<para>
Use this to support <see cref="T:Mono.Options.Option" />s
accepting two values registered with:
</para>
<list type="bullet">
<item>
<term>
<see cref="M:Mono.Options.OptionSet.Add(System.String,Mono.Options.OptionAction{System.String,System.String})" />
</term>
</item>
<item>
<term>
<see cref="M:Mono.Options.OptionSet.Add(System.String,System.String,Mono.Options.OptionAction{System.String,System.String})" />
</term>
</item>
<item>
<term>
<see cref="M:Mono.Options.OptionSet.Add``2(System.String,Mono.Options.OptionAction{``0,``1})" />
</term>
</item>
<item>
<term>
<see cref="M:Mono.Options.OptionSet.Add``2(System.String,System.String,Mono.Options.OptionAction{``0,``1})" />
</term>
</item>
</list>
</remarks>
</Docs>
</Type>

View File

@@ -0,0 +1,196 @@
<Type Name="OptionContext" FullName="Mono.Options.OptionContext">
<TypeSignature Language="C#" Value="public class OptionContext" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit OptionContext extends System.Object" />
<AssemblyInfo>
<AssemblyName>Mono.Options</AssemblyName>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Provides additional context information about the current
<see cref="T:Mono.Options.Option" /> which is being parsed.</summary>
<remarks>
An instance of this class is provided via the registered callback when you
override the
<see cref="M:Mono.Options.Option.OnParseComplete(Mono.Options.OptionContext)" />
method.
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public OptionContext (Mono.Options.OptionSet set);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class Mono.Options.OptionSet set) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="set" Type="Mono.Options.OptionSet" />
</Parameters>
<Docs>
<param name="set">
The <see cref="T:Mono.Options.OptionSet" /> instance to use for
message localization purposes.
</param>
<summary>Constructs and initializes a new instance of the
<see cref="T:Mono.Options.OptionContext" /> class.</summary>
<remarks>
This constructor initializes the
<see cref="P:Mono.Options.OptionContext.OptionSet" /> property of
the new instance using <paramref name="set" />.
</remarks>
</Docs>
</Member>
<Member MemberName="Option">
<MemberSignature Language="C#" Value="public Mono.Options.Option Option { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class Mono.Options.Option Option" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Mono.Options.Option</ReturnType>
</ReturnValue>
<Docs>
<summary>The <see cref="T:Mono.Options.Option" /> being parsed.</summary>
<value>The <see cref="T:Mono.Options.Option" /> being parsed.</value>
<remarks>
</remarks>
</Docs>
</Member>
<Member MemberName="OptionIndex">
<MemberSignature Language="C#" Value="public int OptionIndex { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 OptionIndex" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>
The index within the options list of the last value within
<see cref="P:Mono.Options.OptionContext.OptionValues" />.
</summary>
<value>
A <see cref="T:System.Int32" /> containing the index within the
options list of the last value within
<see cref="P:Mono.Options.OptionContext.OptionValues" />.
</value>
<remarks>
</remarks>
<altmember cref="M:Mono.Options.OptionSet.Parse(System.Collections.Generic.IEnumerable&lt;System.String&gt;)" />
</Docs>
</Member>
<Member MemberName="OptionName">
<MemberSignature Language="C#" Value="public string OptionName { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string OptionName" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>The actual option name used.</summary>
<value>A <see cref="T:System.String" /> containing the actual option name used.</value>
<remarks>
A <see cref="P:Mono.Options.Option.Prototype" /> can contain multiple
<c>|</c>-delimited aliases, e.g. <c>h|help</c>. This property
contains the actual option name specified, e.g. <c>-h</c> vs.
<c>--help</c>.
</remarks>
</Docs>
</Member>
<Member MemberName="OptionSet">
<MemberSignature Language="C#" Value="public Mono.Options.OptionSet OptionSet { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class Mono.Options.OptionSet OptionSet" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Mono.Options.OptionSet</ReturnType>
</ReturnValue>
<Docs>
<summary>
The <see cref="T:Mono.Options.OptionSet" /> to use for message
localizations.
</summary>
<value>
The <see cref="T:Mono.Options.OptionSet" /> to use for message
localizations.
</value>
<remarks>
<para>
This property is initialized in the
<see cref="C:Mono.Options.OptionContext(Mono.Options.OptionSet)" />
constructor.
</para>
</remarks>
</Docs>
</Member>
<Member MemberName="OptionValues">
<MemberSignature Language="C#" Value="public Mono.Options.OptionValueCollection OptionValues { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class Mono.Options.OptionValueCollection OptionValues" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Mono.Options.OptionValueCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>
A collection of <see cref="T:System.String" /> values to provide to
<see cref="P:Mono.Options.OptionContext.Option" />.
</summary>
<value>
A <see cref="T:Mono.Options.OptionValueCollection" /> containing
<see cref="T:System.String" /> values to provide to
<see cref="P:Mono.Options.OptionContext.Option" />.
</value>
<remarks>
<para>
The <see cref="T:Mono.Options.OptionValueCollection" /> indexer
makes use of the
<see cref="P:Mono.Options.Option.OptionValueType" />
and <see cref="P:Mono.Options.Option.MaxValueCount" /> properties.
If the index does not have a value, the index is less than
<see cref="P:Mono.Options.Option.MaxValueCount" />, and the
<see cref="P:Mono.Options.OptionContext.Option" /> has a value
type of <see cref="F:Mono.Options.OptionValueType.Optional" />,
<see langword="null" /> is returned; otherwise an
<see cref="T:Mono.Options.OptionException" /> is thrown.
</para>
</remarks>
</Docs>
</Member>
</Members>
</Type>

View File

@@ -0,0 +1,247 @@
<Type Name="OptionException" FullName="Mono.Options.OptionException">
<TypeSignature Language="C#" Value="public class OptionException : Exception" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit OptionException extends System.Exception" />
<AssemblyInfo>
<AssemblyName>Mono.Options</AssemblyName>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Exception</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Represents the error that occurs when there is an error parsing
an <see cref="T:Mono.Options.Option" />.</summary>
<remarks>
<para>Instances of this class are thrown when:</para>
<list type="bullet">
<item>
<term>There is an exception generated converting a string to an
object of type <typeparamref name="T" /> within the callback
registered by
<see cref="M:Mono.Options.OptionSet.Add``1(System.String,System.String,System.Action{``0})" />
(and related overloads).
</term>
</item>
<item>
<term>
<see cref="M:Mono.Options.Option.Parse``1(System.String,Mono.Options.OptionContext)" />
could not convert a <see cref="T:System.String" /> to an object
of type <typeparamref name="T" />.
</term>
</item>
<item>
<term>
An option with a <see cref="P:Mono.Options.Option.OptionValueType" />
value of <see cref="F:Mono.Options.OptionValueType.Required" />
does not have a value (usually because the start of the option was
the last argument).
</term>
</item>
</list>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public OptionException ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected OptionException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" />
<Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" />
</Parameters>
<Docs>
<param name="info">
The <see cref="T:System.Runtime.Serialization.SerializationInfo" />
that holds the serialized object data about the exception being
thrown.
</param>
<param name="context">
The <see cref="T:System.Runtime.Serialization.StreamingContext" />
that contains contextual information about the source or
destination.
</param>
<summary>
Initializes a new instance of the
<see cref="T:Mono.Options.OptionException" /> class with serialized
data.
</summary>
<remarks>
This constructor is called during deserialization to reconstitute the
exception object transmitted over a stream, e.g. from Remoting.
</remarks>
<altmember cref="M:Mono.Options.OptionException.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public OptionException (string message, string optionName);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message, string optionName) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="message" Type="System.String" />
<Parameter Name="optionName" Type="System.String" />
</Parameters>
<Docs>
<param name="message">
A <see cref="T:System.String" /> that describes the error.
</param>
<param name="optionName">
A <see cref="T:System.String" /> that contains the name of the
option that caused the exception.
</param>
<summary>
Creates and initializes a new instance of the
<see cref="T:Mono.Options.OptionException" /> class.
</summary>
<remarks>
This constructor initializes the
<see cref="P:System.Exception.Message" /> property of the new
instance using <paramref name="message" />, and the
<see cref="P:Mono.Options.OptionException.OptionName" />
property of the new instance using <paramref name="optionName" />.
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public OptionException (string message, string optionName, Exception innerException);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message, string optionName, class System.Exception innerException) cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="message" Type="System.String" />
<Parameter Name="optionName" Type="System.String" />
<Parameter Name="innerException" Type="System.Exception" />
</Parameters>
<Docs>
<param name="message">
A <see cref="T:System.String" /> that describes the error.
</param>
<param name="optionName">
A <see cref="T:System.String" /> that contains the name of the
option that caused the exception.
</param>
<param name="innerException">
An instance of <see cref="T:System.Exception" /> that is the cause
of the current exception. If <paramref name="innerException" /> is
non-<see langword="null" />, then the current Exception was raised
in a catch block handling <paramref name="innerException" />.
</param>
<summary>
Creates and initializes a new instance of the
<see cref="T:Mono.Options.OptionException" /> class.
</summary>
<remarks>
This constructor initializes the
<see cref="P:System.Exception.Message" /> property of the new
instance using <paramref name="message" />, the
<see cref="P:System.Exception.InnerException" /> property of the new
instance using <paramref name="innerException" />, and the
<see cref="P:Mono.Options.OptionException.OptionName" />
property of the new instance using <paramref name="optionName" />.
</remarks>
</Docs>
</Member>
<Member MemberName="GetObjectData">
<MemberSignature Language="C#" Value="public override void GetObjectData (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void GetObjectData(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" />
<Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" />
</Parameters>
<Docs>
<param name="info">
The <see cref="T:System.Runtime.Serialization.SerializationInfo" />
that holds the serialized object data about the exception being
thrown.
</param>
<param name="context">
The <see cref="T:System.Runtime.Serialization.StreamingContext" />
that contains contextual information about the source or
destination.
</param>
<summary>
Adds information about the exception to the provided
<see cref="T:System.Runtime.Serialization.SerializationInfo" />
instance.
</summary>
<remarks>
Adds information about this exception instance to the provided
<see cref="T:System.Runtime.Serialization.SerializationInfo" />,
so that a new cloned instance may be properly reconstituted later.
</remarks>
<altmember cref="C:Mono.Options.OptionException(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
</Docs>
</Member>
<Member MemberName="OptionName">
<MemberSignature Language="C#" Value="public string OptionName { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string OptionName" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>
A <see cref="T:System.String" /> containing the option name that
caused the exception.
</summary>
<value>
A <see cref="T:System.String" /> containing the option name that
caused the exception.
</value>
<remarks>
</remarks>
</Docs>
</Member>
</Members>
</Type>

View File

@@ -0,0 +1 @@
67225ad77680005658a2e3e423e91d7120289bdc

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,103 @@
<Type Name="OptionValueType" FullName="Mono.Options.OptionValueType">
<TypeSignature Language="C#" Value="public enum OptionValueType" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed OptionValueType extends System.Enum" />
<AssemblyInfo>
<AssemblyName>Mono.Options</AssemblyName>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Enum</BaseTypeName>
</Base>
<Docs>
<summary>
Specifies whether or not a <see cref="T:Mono.Options.Option" />
takes a value, and if it does, whether it's optional or required.
</summary>
<remarks>
</remarks>
<altmember cref="P:Mono.Options.Option.OptionValueType" />
</Docs>
<Members>
<Member MemberName="None">
<MemberSignature Language="C#" Value="None" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype Mono.Options.OptionValueType None = int32(0)" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Mono.Options.OptionValueType</ReturnType>
</ReturnValue>
<Docs>
<summary>
<para>No value is taken.</para>
<para>If an option takes no value, then the callback function will
receive <see langword="null" /> if the value is
<see langword="false" /> (e.g. <c>-optionName-</c> was used) and
non-<see langword="null" /> if the value is <see langword="true" />
(e.g. <c>-optionName</c>, <c>-optionName+</c>).</para>
</summary>
</Docs>
</Member>
<Member MemberName="Optional">
<MemberSignature Language="C#" Value="Optional" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype Mono.Options.OptionValueType Optional = int32(1)" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Mono.Options.OptionValueType</ReturnType>
</ReturnValue>
<Docs>
<summary>
<para>A value is optional.</para>
<para>This is specified by providing <c>:</c> after the option name
within <see cref="P:Mono.Options.Option.Prototype" />.</para>
<para>If a value is optional, the callback function will receive
<see langword="null" /> value if no value is provided, and will
otherwise receive a non-<see langword="null" /> value.</para>
<para>Options with optional values are not "greedy" -- the value
must be part of the current argument, e.g. <c>-opt:foo</c> will
pass <c>"foo"</c> as the value to <c>-opt</c>, but <c>-opt foo</c>
will pass <see langword="null" /> as the value to <c>-opt</c>.
</para>
</summary>
</Docs>
</Member>
<Member MemberName="Required">
<MemberSignature Language="C#" Value="Required" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype Mono.Options.OptionValueType Required = int32(2)" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.0.0</AssemblyVersion>
<AssemblyVersion>0.2.1.0</AssemblyVersion>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>Mono.Options.OptionValueType</ReturnType>
</ReturnValue>
<Docs>
<summary>
<para>A value is required.</para>
<para>This is specified by providing <c>=</c> after the option name
within <see cref="P:Mono.Options.Option.Prototype" />.</para>
<para>Options with required values are "greedy" -- if the current
argument does not contain a value, the next argument will be used
as the value, e.g. both <c>-opt:foo</c> and <c>-opt foo</c> will
pass <c>"foo"</c> as the value to <c>-opt</c>.</para>
</summary>
</Docs>
</Member>
</Members>
</Type>

View File

@@ -0,0 +1,139 @@
<Type Name="ResponseFileSource" FullName="Mono.Options.ResponseFileSource">
<TypeSignature Language="C#" Value="public class ResponseFileSource : Mono.Options.ArgumentSource" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ResponseFileSource extends Mono.Options.ArgumentSource" />
<AssemblyInfo>
<AssemblyName>Mono.Options</AssemblyName>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>Mono.Options.ArgumentSource</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>
Inserts the contents of a file during argument processing.
</summary>
<remarks>
<para>
<c>ResponseFileSource</c> looks for arguments which start with
<c>@</c>, assumes that what follows the <c>@</c> is a valid filename,
and reads the contents of the filename as the replacement text.
</para>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ResponseFileSource ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>
Constructs and initializes a
<see cref="T:Mono.Options.ResponseFileSource" /> instance.
</summary>
<remarks>
</remarks>
</Docs>
</Member>
<Member MemberName="Description">
<MemberSignature Language="C#" Value="public override string Description { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Description" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>
The description to provide for the argument source within
<see cref="M:Mono.Options.OptionSet.WriteOptionDescriptions(System.IO.TextWriter)" />.
</summary>
<value>
<c>"Read response file for more options."</c>.
</value>
<remarks>
</remarks>
</Docs>
</Member>
<Member MemberName="GetArguments">
<MemberSignature Language="C#" Value="public override bool GetArguments (string value, out System.Collections.Generic.IEnumerable&lt;string&gt; replacement);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool GetArguments(string value, class System.Collections.Generic.IEnumerable`1&lt;string&gt; replacement) cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="value" Type="System.String" />
<Parameter Name="replacement" Type="System.Collections.Generic.IEnumerable&lt;System.String&gt;&amp;" RefType="out" />
</Parameters>
<Docs>
<param name="value">
A <see cref="T:System.String" /> containing the argument to replace
with additional arguments.
</param>
<param name="replacement">
A <see cref="T:System.Collections.Generic.IEnumerable{System.String}" />
which will refer to teh replacement arguments if this method returns
<see langword="true" />; otherwise, this value should be ignored by
callers.
</param>
<summary>
Replace the argument <paramref name="value" /> with the contents of
the specified file.
</summary>
<returns>
If <paramref name="value" /> starts with <c>@</c>, then
<paramref name="replacement" /> will contain the parsed contents of
the filename resulting from <c><paramref name="value" />.Substring(1)</c>
and <see langword="true" /> is returned; otherwise,
<see langword="false" /> is returned.
</returns>
<remarks>
</remarks>
<exception cref="T:System.IO.IOException">
<paramref name="value" /> starts with <c>@</c> and
<c><paramref name="value" />.Substring(1)</c> doees not exist.
</exception>
<altmember cref="M:Mono.Options.ArgumentSource.GetArgumentsFromFile(System.String)" />
</Docs>
</Member>
<Member MemberName="GetNames">
<MemberSignature Language="C#" Value="public override string[] GetNames ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance string[] GetNames() cil managed" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.2.2.0</AssemblyVersion>
<AssemblyVersion>0.2.3.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String[]</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>
The names to provide for the argument source within
<see cref="M:Mono.Options.OptionSet.WriteOptionDescriptions(System.IO.TextWriter)" />.
</summary>
<returns>
A <see cref="T:System.String" /> array containing
an element with the value <c>"@file"</c>.
</returns>
<remarks>
</remarks>
</Docs>
</Member>
</Members>
</Type>

View File

@@ -0,0 +1,80 @@
using System;
using System.Linq;
using System.Collections.Generic;
using Mono.Options;
class Test {
public static void Main (string[] args)
{
var show_help = false;
var macros = new Dictionary<string, string>();
bool create = false, extract = false, list = false;
string output = null, input = null;
string color = null;
var p = new OptionSet () {
"Usage: bundling [OPTIONS]+",
"Demo program to show the effects of bundling options and their values",
"",
"gcc-like options:",
{ "D:", "Predefine a macro with an (optional) value.",
(m, v) => {
if (m == null)
throw new OptionException ("Missing macro name for option -D.",
"-D");
macros.Add (m, v);
} },
{ "d={-->}{=>}", "Alternate macro syntax.",
(m, v) => macros.Add (m, v) },
{ "o=", "Specify the output file", v => output = v },
"",
"tar-like options:",
{ "f=", "The input file", v => input = v },
{ "x", "Extract the file", v => extract = v != null },
{ "c", "Create the file", v => create = v != null },
{ "t", "List the file", v => list = v != null },
"",
"ls-like optional values:",
{ "color:", "control whether and when color is used",
v => color = v },
"",
"other:",
{ "h|help", "show this message and exit",
v => show_help = v != null },
// default
{ "<>",
v => Console.WriteLine ("def handler: color={0}; arg={1}", color, v)},
};
try {
p.Parse (args);
}
catch (OptionException e) {
Console.Write ("bundling: ");
Console.WriteLine (e.Message);
Console.WriteLine ("Try `greet --help' for more information.");
return;
}
if (show_help) {
p.WriteOptionDescriptions (Console.Out);
return;
}
Console.WriteLine ("Macros:");
foreach (var m in (from k in macros.Keys orderby k select k)) {
Console.WriteLine ("\t{0}={1}", m, macros [m] ?? "<null>");
}
Console.WriteLine ("Options:");
Console.WriteLine ("\t Input File: {0}", input);
Console.WriteLine ("\tOuptut File: {0}", output);
Console.WriteLine ("\t Create: {0}", create);
Console.WriteLine ("\t Extract: {0}", extract);
Console.WriteLine ("\t List: {0}", list);
Console.WriteLine ("\t Color: {0}", color ?? "<null>");
}
}

View File

@@ -0,0 +1,13 @@
mono Documentation/en/examples/bundling.exe --help
mono Documentation/en/examples/bundling.exe -D
mono Documentation/en/examples/bundling.exe -DA -DB=C "-dD-->E" "-dF=>G" -d "H=>I" -cf input --color -ooutput
mono Documentation/en/examples/bundling.exe -cfv input
mono Documentation/en/examples/bundling.exe -xctf input
mono Documentation/en/examples/bundling.exe --color=auto -o output -finput
mono Documentation/en/examples/bundling.exe --color=on A B --color=off C D

View File

@@ -0,0 +1,84 @@
$ mono bundling.exe --help
Usage: bundling [OPTIONS]+
Demo program to show the effects of bundling options and their values
gcc-like options:
-D[=VALUE1:VALUE2] Predefine a macro with an (optional) value.
-d=VALUE1-->VALUE2 Alternate macro syntax.
-o=VALUE Specify the output file
tar-like options:
-f=VALUE The input file
-x Extract the file
-c Create the file
-t List the file
ls-like optional values:
--color[=VALUE] control whether and when color is used
other:
-h, --help show this message and exit
$ mono bundling.exe -D
bundling: Missing macro name for option -D.
Try `greet --help' for more information.
$ mono bundling.exe -DA -DB=C "-dD-->E" "-dF=>G" -d "H=>I" -cf input --color -ooutput
Macros:
A=<null>
B=C
D=E
F=G
H=I
Options:
Input File: input
Ouptut File: output
Create: True
Extract: False
List: False
Color: <null>
$ mono bundling.exe -cfv input
def handler: color=; arg=input
Macros:
Options:
Input File: v
Ouptut File:
Create: True
Extract: False
List: False
Color: <null>
$ mono bundling.exe -xctf input
Macros:
Options:
Input File: input
Ouptut File:
Create: True
Extract: True
List: True
Color: <null>
$ mono bundling.exe --color=auto -o output -finput
Macros:
Options:
Input File: input
Ouptut File: output
Create: False
Extract: False
List: False
Color: auto
$ mono bundling.exe --color=on A B --color=off C D
def handler: color=on; arg=A
def handler: color=on; arg=B
def handler: color=off; arg=C
def handler: color=off; arg=D
Macros:
Options:
Input File:
Ouptut File:
Create: False
Extract: False
List: False
Color: off

View File

@@ -0,0 +1,78 @@
using System;
using System.ComponentModel;
using System.Globalization;
using Mono.Options;
class FooConverter : TypeConverter {
public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
{
if (sourceType == typeof (string))
return true;
return base.CanConvertFrom (context, sourceType);
}
public override object ConvertFrom (ITypeDescriptorContext context,
CultureInfo culture, object value)
{
string v = value as string;
if (v != null) {
switch (v) {
case "A": return Foo.A;
case "B": return Foo.B;
}
}
return base.ConvertFrom (context, culture, value);
}
}
[TypeConverter (typeof(FooConverter))]
class Foo {
public static readonly Foo A = new Foo ("A");
public static readonly Foo B = new Foo ("B");
string s;
Foo (string s) { this.s = s; }
public override string ToString () {return s;}
}
class DemoOption<T> : Option {
Action<T> action;
public DemoOption (string prototype, Action<T> action)
: base (prototype, null)
{
this.action = action;
}
protected override void OnParseComplete (OptionContext c)
{
Console.WriteLine ("# Parsed {0}; Value={1}; Index={2}",
c.OptionName, c.OptionValues [0] ?? "<null>", c.OptionIndex);
action (Parse<T> (c.OptionValues [0], c));
}
}
class Test {
public static void Main (string[] args)
{
Foo f = null;
int n = -1;
string s = null;
OptionSet p = new OptionSet () {
new DemoOption<Foo> ("f:", v => f = v),
new DemoOption<int> ("n=", v => n = v),
new DemoOption<string> ("s:", v => s = v),
};
try {
p.Parse (args);
}
catch (OptionException e) {
Console.Write ("context: ");
Console.WriteLine (e.Message);
return;
}
Console.WriteLine ("f={0}", f == null ? "<null>" : f.ToString ());
Console.WriteLine ("n={0}", n);
Console.WriteLine ("s={0}", s ?? "<null>");
}
}

View File

@@ -0,0 +1,13 @@
mono Documentation/en/examples/context.exe -f
mono Documentation/en/examples/context.exe -n
mono Documentation/en/examples/context.exe -s
mono Documentation/en/examples/context.exe -f=invalid
mono Documentation/en/examples/context.exe -n invalid
mono Documentation/en/examples/context.exe -s=
mono Documentation/en/examples/context.exe -f=A --n=42 /s=fourty-two

View File

@@ -0,0 +1,36 @@
$ mono context.exe -f
# Parsed -f; Value=<null>; Index=0
f=<null>
n=-1
s=<null>
$ mono context.exe -n
context: Missing required value for option '-n'.
$ mono context.exe -s
# Parsed -s; Value=<null>; Index=0
f=<null>
n=-1
s=<null>
$ mono context.exe -f=invalid
# Parsed -f; Value=invalid; Index=0
context: Could not convert string `invalid' to type Foo for option `-f'.
$ mono context.exe -n invalid
# Parsed -n; Value=invalid; Index=1
context: Could not convert string `invalid' to type Int32 for option `-n'.
$ mono context.exe -s=
# Parsed -s; Value=; Index=0
f=<null>
n=-1
s=
$ mono context.exe -f=A --n=42 /s=fourty-two
# Parsed -f; Value=A; Index=0
# Parsed --n; Value=42; Index=1
# Parsed /s; Value=fourty-two; Index=2
f=A
n=42
s=fourty-two

View File

@@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using Mono.Options;
class Test {
static int verbosity;
public static void Main (string[] args)
{
bool show_help = false;
List<string> names = new List<string> ();
int repeat = 1;
var p = new OptionSet () {
"Usage: greet [OPTIONS]+ message",
"Greet a list of individuals with an optional message.",
"If no message is specified, a generic greeting is used.",
"",
"Options:",
{ "n|name=", "the {NAME} of someone to greet.",
v => names.Add (v) },
{ "r|repeat=",
"the number of {TIMES} to repeat the greeting.\n" +
"this must be an integer.",
(int v) => repeat = v },
{ "v", "increase debug message verbosity",
v => { if (v != null) ++verbosity; } },
{ "h|help", "show this message and exit",
v => show_help = v != null },
};
List<string> extra;
try {
extra = p.Parse (args);
}
catch (OptionException e) {
Console.Write ("greet: ");
Console.WriteLine (e.Message);
Console.WriteLine ("Try `greet --help' for more information.");
return;
}
if (show_help) {
p.WriteOptionDescriptions (Console.Out);
return;
}
string message;
if (extra.Count > 0) {
message = string.Join (" ", extra.ToArray ());
Debug ("Using new message: {0}", message);
}
else {
message = "Hello {0}!";
Debug ("Using default message: {0}", message);
}
foreach (string name in names) {
for (int i = 0; i < repeat; ++i)
Console.WriteLine (message, name);
}
}
static void Debug (string format, params object[] args)
{
if (verbosity > 0) {
Console.Write ("# ");
Console.WriteLine (format, args);
}
}
}

View File

@@ -0,0 +1,9 @@
mono Documentation/en/examples/greet.exe --help
mono Documentation/en/examples/greet.exe -v- -n A -name=B --name=C /name D -nE
mono Documentation/en/examples/greet.exe -v -n E custom greeting for: {0}
mono Documentation/en/examples/greet.exe -r 3 -n A
mono Documentation/en/examples/greet.exe -r not-an-int

View File

@@ -0,0 +1,31 @@
$ mono greet.exe --help
Usage: greet [OPTIONS]+ message
Greet a list of individuals with an optional message.
If no message is specified, a generic greeting is used.
Options:
-n, --name=NAME the NAME of someone to greet.
-r, --repeat=TIMES the number of TIMES to repeat the greeting.
this must be an integer.
-v increase debug message verbosity
-h, --help show this message and exit
$ mono greet.exe -v- -n A -name=B --name=C /name D -nE
Hello A!
Hello B!
Hello C!
Hello D!
Hello E!
$ mono greet.exe -v -n E custom greeting for: {0}
# Using new message: custom greeting for: {0}
custom greeting for: E
$ mono greet.exe -r 3 -n A
Hello A!
Hello A!
Hello A!
$ mono greet.exe -r not-an-int
greet: Could not convert string `not-an-int' to type Int32 for option `-r'.
Try `greet --help' for more information.

View File

@@ -0,0 +1,86 @@
# NDesk.Options localization example.
# Copyright (C) 2008 Novell, Inc.
# This file is distributed under the same license as the NDesk.Options package.
# Jonathan Pryor <jonpryor@vt.edu>, 2008
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: NDesk.Options localization demo 1.0\n"
"Report-Msgid-Bugs-To: jonpryor@vt.edu\n"
"POT-Creation-Date: 2008-01-19 13:59-0500\n"
"PO-Revision-Date: 2008-01-19 02:43+EST\n"
"Last-Translator: Google\n"
"Language-Team: http://translate.google.com/translate_t?langpair=en|es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: localization.cs:16
msgid "with-unix"
msgstr ""
#: localization.cs:19
msgid "with-hello"
msgstr ""
#: localization.cs:20
msgid "hello:"
msgstr ""
#: localization.cs:21
msgid "with-default"
msgstr ""
#: localization.cs:26
msgid "localization"
msgstr ""
#: localization.cs:28
msgid "locale"
msgstr ""
#: localization.cs:34
msgid "h|?|help"
msgstr ""
#: localization.cs:34
msgid "show this message and exit."
msgstr "A mostrar este mensaje y salir."
#: localization.cs:36
msgid "v|verbose"
msgstr ""
#: localization.cs:36
msgid "increase message verbosity."
msgstr "Aumento mensaje verbosidad."
#: localization.cs:38
msgid "n="
msgstr ""
#: localization.cs:38
msgid "must be an int"
msgstr "Debe ser un int"
#: localization.cs:40
msgid "V|version"
msgstr ""
#: localization.cs:40
msgid "output version information and exit."
msgstr "Salida de información de versión y sale."
#: localization.cs:47
msgid "localization: "
msgstr ""
#: localization.cs:54
msgid "NDesk.Options Localizer Demo 1.0"
msgstr ""
#: localization.cs:56
#, csharp-format
msgid "Message level: {0}"
msgstr ""

Some files were not shown because too many files have changed in this diff Show More