Merge branch 'v3.4'
[dotnetopenid.git] / tools / Sandcastle / Source / CommandLine / SwitchOption.cs
blob394d137cf23a6f3bb315fd954be4f7c6bfc03dfe
1 // Copyright © Microsoft Corporation.
2 // This source file is subject to the Microsoft Permissive License.
3 // See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
4 // All other rights reserved.
6 using System;
7 using System.IO;
8 using System.Collections.Generic;
10 namespace Microsoft.Ddue.Tools.CommandLine {
12 public sealed class SwitchOption : Option {
14 public SwitchOption(string name) : base(name) { }
16 public SwitchOption(string name, string description) : base(name, description) { }
18 internal override ParseResult ParseArgument(string argument) {
19 if (argument.Length > 0) return (ParseResult.MalformedArgument);
20 if (present) return (ParseResult.MultipleOccurance);
21 present = true;
22 return (ParseResult.Success);
25 internal override void WriteTemplate(TextWriter writer) {
26 writer.WriteLine("/{0}", Name);