BadScript 2
Loading...
Searching...
No Matches
Help_Fakes.cs
Go to the documentation of this file.
1// Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
2
3using System.Collections.Generic;
5
7{
9 {
10 [Option('v', "verbose")]
11 public bool Verbose { get; set; }
12
13 [Option("input-file")]
14 public string FileName { get; set; }
15
16 [Option("secert-option", Hidden = true, HelpText = "This is a description for a secert hidden option that should never be visibile to the user via help text.")]
17 public string SecertOption { get; set; }
18 }
19
21 {
22 [Option('v', "verbose", HelpText = "Comment extensively every operation.")]
23 public bool Verbose { get; set; }
24
25 [Option('i', "input-file", Required = true, HelpText = "Specify input file to be processed.")]
26 public string FileName { get; set; }
27
28 [Option("secert-option", Hidden = true, HelpText = "This is a description for a secert hidden option that should never be visibile to the user via help text.")]
29 public string SecertOption { get; set; }
30 }
31
33 {
34 [Option('v', "verbose", HelpText = "This is the description of the verbosity to test out the wrapping capabilities of the Help Text.")]
35 public bool Verbose { get; set; }
36
37 [Option("input-file", HelpText = "This is a very long description of the Input File argument that gets passed in. It should be passed in as a string.")]
38 public string FileName { get; set; }
39
40 [Option("secert-option", Hidden = true, HelpText = "This is a description for a secert hidden option that should never be visibile to the user via help text.")]
41 public string SecertOption { get; set; }
42 }
43
45 {
46 [Option('v', "verbose", HelpText = "Before 012345678901234567890123 After")]
47 public bool Verbose { get; set; }
48
49 [Option("input-file", HelpText = "Before 012345678901234567890123456789 After")]
50 public string FileName { get; set; }
51
52 [Option("secert-option", Hidden = true, HelpText = "This is a description for a secert hidden option that should never be visibile to the user via help text.")]
53 public string SecertOption { get; set; }
54 }
55
57 {
58 [Option('i',"input", HelpText = "Set input file.")]
59 public string InputFile { get; set; }
60
61 [Option('i', "output", HelpText = "Set output file.")]
62 public string OutputFile { get; set; }
63
64 [Option(HelpText = "Set verbosity level.")]
65 public bool Verbose { get; set; }
66
67 [Option('w', "warns", HelpText = "Log warnings.")]
68 public bool LogWarning { get; set; }
69
70 [Option('e', "errs", HelpText = "Log errors.")]
71 public bool LogError { get; set; }
72
73 [Option('l', Separator = ',', HelpText = "List.")]
74 public IEnumerable<int> Sequence { get; set; }
75
76 [Value(0, HelpText = "Value.")]
77 public string Value { get; set; }
78
79 [Option("secert-option", Hidden = true, HelpText = "This is a description for a secert hidden option that should never be visibile to the user via help text.")]
80 public string SecertOption { get; set; }
81
82 [ Custom
83 , Usage(ApplicationAlias = "mono testapp.exe")
84 ]
85 public static IEnumerable<Example> Examples
86 {
87 get
88 {
89 yield return new Example("Normal scenario", new Options_With_Usage_Attribute { InputFile = "file.bin", OutputFile = "out.bin" });
90 yield return new Example("Logging warnings", UnParserSettings.WithGroupSwitchesOnly() , new Options_With_Usage_Attribute { InputFile = "file.bin", LogWarning = true });
91 yield return new Example("Logging errors", new[] { UnParserSettings.WithGroupSwitchesOnly(), UnParserSettings.WithUseEqualTokenOnly() }, new Options_With_Usage_Attribute { InputFile = "file.bin", LogError = true });
92 yield return new Example("List", new Options_With_Usage_Attribute { Sequence = new[] { 1, 2 } });
93 yield return new Example("Value", new Options_With_Usage_Attribute { Value = "value" });
94 }
95 }
96 }
97
98 [Verb("secert", Hidden = true, HelpText = "This is a secert hidden verb that should never be visible to the user via help text.")]
99 public class Secert_Verb
100 {
101 [Option('f', "force", SetName = "mode-f", HelpText = "Allow adding otherwise ignored files.")]
102 public bool Force { get; set; }
103
104 [Option("secert-option", Hidden = true, HelpText = "This is a description for a secert hidden option that should never be visibile to the user via help text.")]
105 public string SecertOption { get; set; }
106 }
107
108 [Verb("add", HelpText = "Add file contents to the index.")]
110 {
111 [Option('p', "patch", SetName = "mode-p",
112 HelpText = "Interactively choose hunks of patch between the index and the work tree and add them to the index.")]
113 public bool Patch { get; set; }
114
115 [Option('f', "force", SetName = "mode-f",
116 HelpText = "Allow adding otherwise ignored files.")]
117 public bool Force { get; set; }
118
119 [Value(0)]
120 public string FileName { get; set; }
121
122 [Option("secert-option", Hidden = true, HelpText = "This is a description for a secert hidden option that should never be visibile to the user via help text.")]
123 public string SecertOption { get; set; }
124
125 [Usage(ApplicationAlias = "git")]
126 public static IEnumerable<Example> Examples
127 {
128 get
129 {
130 yield return new Example("Forcing file", new Add_Verb { FileName = "README.md", Force = true });
131 }
132 }
133 }
134
135 [Verb("commit", HelpText = "Record changes to the repository.")]
137 {
138 [Option('p', "patch",
139 HelpText = "Use the interactive patch selection interface to chose which changes to commit.")]
140 public bool Patch { get; set; }
141
142 [Option("amend", HelpText = "Used to amend the tip of the current branch.")]
143 public bool Amend { get; set; }
144
145 [Option("secert-option", Hidden = true, HelpText = "This is a description for a secert hidden option that should never be visibile to the user via help text.")]
146 public string SecertOption { get; set; }
147
148 [Usage(ApplicationAlias = "git")]
149 public static IEnumerable<Example> Examples
150 {
151 get
152 {
153 yield return new Example("Committing work", new Commit_Verb_With_Usage_Attribute { Patch = true });
154 }
155 }
156 }
157
158 [Verb("clone", HelpText = "Clone a repository into a new directory.")]
160 {
161 [Option("no-hardlinks",
162 HelpText = "Optimize the cloning process from a repository on a local filesystem by copying files.")]
163 public bool NoHardLinks { get; set; }
164
165 [Option('q', "quiet",
166 HelpText = "Suppress summary message.")]
167 public bool Quiet { get; set; }
168
169 [Option("secert-option", Hidden = true, HelpText = "This is a description for a secert hidden option that should never be visibile to the user via help text.")]
170 public string SecertOption { get; set; }
171
172 [Value(0, MetaName = "URLS",
173 HelpText = "A list of url(s) to clone.")]
174 public IEnumerable<string> Urls { get; set; }
175
176 [Usage(ApplicationAlias = "git")]
177 public static IEnumerable<Example> Examples
178 {
179 get
180 {
181 yield return new Example("Basic cloning", new Clone_Verb_With_Usage_Attribute { Urls = new[] { "https://github.com/gsscoder/csharpx" } });
182 yield return new Example("Cloning quietly", new Clone_Verb_With_Usage_Attribute { Quiet = true, Urls = new[] { "https://github.com/gsscoder/railwaysharp" } });
183 yield return new Example("Cloning without hard links", new Clone_Verb_With_Usage_Attribute { NoHardLinks = true, Urls = new[] { "https://github.com/gsscoder/csharpx" } });
184 }
185 }
186 }
187}
Models a command line usage example.
Definition Example.cs:13
Provides settings for when formatting command line from an options instance../>.
static UnParserSettings WithGroupSwitchesOnly()
Factory method that creates an instance of CommandLine.UnParserSettings with GroupSwitches set to tru...
static UnParserSettings WithUseEqualTokenOnly()
Factory method that creates an instance of CommandLine.UnParserSettings with UseEqualToken set to tru...