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.
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
);
22 return (ParseResult
.Success
);
25 internal override void WriteTemplate(TextWriter writer
) {
26 writer
.WriteLine("/{0}", Name
);