diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-09-20 21:18:59 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-09-21 08:06:22 -0700 |
commit | bbe3f9cc9c8a1e5909273c1a162a63ea7a66afd8 (patch) | |
tree | c91f66e642c4d26fca266e226b3f2765f546d700 /tools/Sandcastle/Source/CommandLine/StringOption.cs | |
parent | 627014f0bbc3fd576277375e70f8391d150b0a67 (diff) | |
download | DotNetOpenAuth-bbe3f9cc9c8a1e5909273c1a162a63ea7a66afd8.zip DotNetOpenAuth-bbe3f9cc9c8a1e5909273c1a162a63ea7a66afd8.tar.gz DotNetOpenAuth-bbe3f9cc9c8a1e5909273c1a162a63ea7a66afd8.tar.bz2 |
Switched out the Sandcastle binaries for the source code.
Diffstat (limited to 'tools/Sandcastle/Source/CommandLine/StringOption.cs')
-rw-r--r-- | tools/Sandcastle/Source/CommandLine/StringOption.cs | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tools/Sandcastle/Source/CommandLine/StringOption.cs b/tools/Sandcastle/Source/CommandLine/StringOption.cs new file mode 100644 index 0000000..4680a56 --- /dev/null +++ b/tools/Sandcastle/Source/CommandLine/StringOption.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// + +using System; +using System.IO; +using System.Collections.Generic; + +namespace Microsoft.Ddue.Tools.CommandLine { + + public sealed class StringOption : Option { + + private string template = "xxxx"; + + public StringOption(string name) : base(name) { } + + public StringOption(string name, string description) : base(name, description) { } + + public StringOption(string name, string description, string template) : base(name, description) { + this.template = template; + } + + public string Template { + get { + return (template); + } + set { + template = value; + } + } + + internal override ParseResult ParseArgument(string argument) { + if (!(argument.Length > 0)) return (ParseResult.MalformedArgument); + if (argument[0] != ':') return (ParseResult.MalformedArgument); + if (present) return (ParseResult.MultipleOccurance); + present = true; + value = argument.Substring(1); + return (ParseResult.Success); + } + + internal override void WriteTemplate(TextWriter writer) { + writer.WriteLine("/{0}:{1}", Name, template); + } + + } + +} |