forked from commandlineparser/commandline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVerb_Fakes.cs
109 lines (89 loc) · 3.46 KB
/
Verb_Fakes.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
using System.Collections.Generic;
namespace CommandLine.Tests.Fakes
{
[Verb("add", HelpText = "Add file contents to the index.")]
public class Add_Verb
{
[Option('p', "patch", SetName = "mode-p",
HelpText = "Interactively choose hunks of patch between the index and the work tree and add them to the index.")]
public bool Patch { get; set; }
[Option('f', "force", SetName = "mode-f",
HelpText = "Allow adding otherwise ignored files.")]
public bool Force { get; set; }
[Value(0)]
public string FileName { get; set; }
}
[Verb("commit", HelpText = "Record changes to the repository.")]
public class Commit_Verb
{
[Option('p', "patch",
HelpText = "Use the interactive patch selection interface to chose which changes to commit.")]
public bool Patch { get; set; }
[Option("amend", HelpText = "Used to amend the tip of the current branch.")]
public bool Amend { get; set; }
[Option('m', "message", HelpText = "Use the given message as the commit message.")]
public string Message { get; set; }
}
[Verb("clone", HelpText = "Clone a repository into a new directory.")]
public class Clone_Verb
{
[Option("no-hardlinks",
HelpText = "Optimize the cloning process from a repository on a local filesystem by copying files.")]
public bool NoHardLinks { get; set; }
[Option('q', "quiet",
HelpText = "Suppress summary message.")]
public bool Quiet { get; set; }
[Value(0)]
public IEnumerable<string> Urls { get; set; }
}
[Verb("sequence", HelpText = "Sequence options test.")]
public class SequenceOptions
{
[Option("long-seq", Separator = ';')]
public IEnumerable<long> LongSequence { get; set; }
[Option('s', Min = 1, Max = 100, Separator = ',')]
public IEnumerable<string> StringSequence { get; set; }
}
abstract class Base_Class_For_Verb
{
[Option('p', "patch", SetName = "mode",
HelpText = "Interactively choose hunks of patch between the index and the work tree and add them to the index.")]
public bool Patch { get; set; }
[Value(0)]
public string FileName { get; set; }
}
[Verb("derivedadd", HelpText = "Add file contents to the index.")]
class Derived_Verb : Base_Class_For_Verb
{
[Option('f', "force", SetName = "mode",
HelpText = "Allow adding otherwise ignored files.")]
public bool Force { get; set; }
}
[Verb("test")]
class Verb_With_Option_And_Value_Of_String_Type
{
[Option('o', "opt")]
public string OptValue { get; set; }
[Value(0)]
public string PosValue { get; set; }
}
[Verb("default1", true)]
class Default_Verb_One
{
[Option('t', "test-one")]
public bool TestValueOne { get; set; }
}
[Verb("default2", true)]
class Default_Verb_Two
{
[Option('t', "test-two")]
public bool TestValueTwo { get; set; }
}
[Verb(null, true)]
class Default_Verb_With_Empty_Name
{
[Option('t', "test")]
public bool TestValue { get; set; }
}
}