-
Notifications
You must be signed in to change notification settings - Fork 0
/
Enums.html
321 lines (295 loc) · 14.5 KB
/
Enums.html
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<!DOCTYPE html>
<html lang="en">
<head>
<title>Enumerations Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset="utf-8">
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
<script src="js/lunr.min.js" defer></script>
<script src="js/typeahead.jquery.js" defer></script>
<script src="js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Section/Enumerations" class="dashAnchor"></a>
<a title="Enumerations Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="index.html">
Docs
</a>
(98% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
<p class="header-col header-col--secondary">
<a class="header-link" href="https://github.com/nsomar/Guaka/tree/master">
<img class="header-icon" src="img/gh.png"/>
View on GitHub
</a>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="index.html"> Reference</a>
<img class="carat" src="img/carat.png" />
Enumerations Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Classes/Command.html">Command</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Enums.html">Enumerations</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/CommandError.html">CommandError</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/DeprecationStatus.html">DeprecationStatus</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Enums/FlagValueError.html">FlagValueError</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Extensions/Bool.html">Bool</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Extensions/Int.html">Int</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Extensions/String.html">String</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Functions.html">Functions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Functions.html#/s:5Guaka2eeoiySbAA4FlagV_ADtF">==(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Functions.html#/s:5Guaka4fail10statusCode7commands5NeverOSi_AA7CommandCtF">fail(statusCode:command:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Functions.html#/s:5Guaka4fail10statusCode12errorMessages5NeverOSi_SStF">fail(statusCode:errorMessage:)</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/FlagValue.html">FlagValue</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Protocols/HelpGenerator.html">HelpGenerator</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Structs.html">Structures</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Structs/CommandHelp.html">CommandHelp</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Structs/Flag.html">Flag</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Structs/FlagHelp.html">FlagHelp</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Structs/Flags.html">Flags</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Structs/GuakaConfig.html">GuakaConfig</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="Typealiases.html">Type Aliases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/s:5Guaka14ConditionalRuna">ConditionalRun</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/s:5Guaka13Configurationa">Configuration</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="Typealiases.html#/s:5Guaka3Runa">Run</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>Enumerations</h1>
<p>The following enumerations are available globally.</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:5Guaka17DeprecationStatusO"></a>
<a name="//apple_ref/swift/Enum/DeprecationStatus" class="dashAnchor"></a>
<a class="token" href="#/s:5Guaka17DeprecationStatusO">DeprecationStatus</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Deprecation status type for flags and commands</p>
<ul>
<li>notDeprecated: not deprecated, this is the default</li>
<li>deprecated: the flag/command is deprecated</li>
</ul>
<a href="Enums/DeprecationStatus.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">DeprecationStatus</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/nsomar/Guaka/Sources/Guaka/Command/CommandTypes.swift#L13-L34">Show on GitHub</a>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:5Guaka12CommandErrorO"></a>
<a name="//apple_ref/swift/Enum/CommandError" class="dashAnchor"></a>
<a class="token" href="#/s:5Guaka12CommandErrorO">CommandError</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Command Error Enum</p>
<ul>
<li>wrongFlagPattern: Received a wrong flag patter, such as <code>---f</code></li>
<li>flagNeedsValue: Flag requires a value that was not set</li>
<li>flagNotFound: Flag with name cannot be found</li>
<li>requiredFlagsWasNotSet: Required flag was not set</li>
<li>unexpectedFlagPassed: Parsed an unexpected flag name</li>
<li>commandGeneralError: General command related error</li>
<li>unknownError: Unknown error occured</li>
<li>incorrectFlagValue: An incorrect value type was passed to the flag</li>
<li>wrongCommandUsageString: Wrong usage string was passed to the command</li>
<li>wrongFlagLongName: Wrong long name was passed for flag</li>
<li>wrongFlagShortName: Wrong long name was passed for flag</li>
</ul>
<a href="Enums/CommandError.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">CommandError</span> <span class="p">:</span> <span class="kt">Error</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/nsomar/Guaka/Sources/Guaka/Types/Errors.swift#L23-L57">Show on GitHub</a>
</div>
</section>
</div>
</li>
</ul>
</div>
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:5Guaka14FlagValueErrorO"></a>
<a name="//apple_ref/swift/Enum/FlagValueError" class="dashAnchor"></a>
<a class="token" href="#/s:5Guaka14FlagValueErrorO">FlagValueError</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Error to throw when converting string to FlagValue</p>
<ul>
<li>conversionError: conversation error string
This string will be used to be printed to the console</li>
</ul>
<hr>
<p>Example</p>
<pre class="highlight swift"><code><span class="kd">struct</span> <span class="kt">User</span><span class="p">:</span> <span class="kt">FlagValue</span> <span class="p">{</span>
<span class="k">let</span> <span class="nv">name</span><span class="p">:</span> <span class="kt">String</span>
<span class="kd">static</span> <span class="kd">func</span> <span class="nf">fromString</span><span class="p">(</span><span class="n">flagValue</span> <span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="k">throws</span> <span class="o">-></span> <span class="kt">User</span> <span class="p">{</span>
<span class="k">if</span> <span class="n">value</span> <span class="o">==</span> <span class="s">"wrong"</span> <span class="p">{</span>
<span class="k">throw</span> <span class="kt">FlagValueError</span><span class="o">.</span><span class="nf">conversionError</span><span class="p">(</span><span class="s">"wrong user passed"</span><span class="p">)</span>
<span class="p">}</span>
<span class="k">return</span> <span class="kt">User</span><span class="p">(</span><span class="nv">name</span><span class="p">:</span> <span class="n">value</span><span class="p">)</span>
<span class="p">}</span>
<span class="kd">static</span> <span class="k">var</span> <span class="nv">typeDescription</span><span class="p">:</span> <span class="kt">String</span> <span class="p">{</span>
<span class="k">return</span> <span class="s">"A user structure"</span>
<span class="p">}</span>
<span class="p">}</span>
</code></pre>
<a href="Enums/FlagValueError.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">FlagValueError</span> <span class="p">:</span> <span class="kt">Error</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/nsomar/Guaka/Sources/Guaka/Types/FlagValue.swift#L144-L177">Show on GitHub</a>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>© 2018 <a class="link" href="https://getguaka.github.io" target="_blank" rel="external">The Guaka Authors</a>. All rights reserved. (Last updated: 2018-10-04)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>