-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
150 lines (133 loc) · 18.2 KB
/
index.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
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- This file is generated by Nim. -->
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>src/cliche</title>
<!-- Favicon -->
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
<link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="nimdoc.out.css">
<!-- JS -->
<script type="text/javascript" src="dochack.js"></script>
</head>
<body>
<div class="document" id="documentId">
<div class="container">
<h1 class="title">src/cliche</h1>
<div class="row">
<div class="three columns">
<div class="theme-select-wrapper">
<label for="theme-select">Theme: </label>
<select id="theme-select" onchange="setTheme(this.value)">
<option value="auto">🌗 Match OS</option>
<option value="dark">🌑 Dark</option>
<option value="light">🌕 Light</option>
</select>
</div>
<div id="global-links">
<ul class="simple">
<li><a href="theindex.html">Index</a></li>
</ul>
</div>
<div id="searchInputDiv">
Search: <input type="search" id="searchInput" onkeyup="search()"/>
</div>
<div>
Group by:
<select onchange="groupBy(this.value)">
<option value="section">Section</option>
<option value="type">Type</option>
</select>
</div>
<ul class="simple simple-toc" id="toc-list">
<li>
<details open>
<summary><a class="reference reference-toplevel" href="#17" id="67">Macros</a></summary>
<ul class="simple simple-toc-section">
<ul class="simple nested-toc-section">getOpt
<li><a class="reference" href="#getOpt.m%2Cseq%5Bstring%5D%2Cuntyped%2Cstatic%5Bstring%5D%2Cstatic%5Bchar%5D%2Cstatic%5Bchar%5D%2Cstatic%5Bbool%5D" title="getOpt(source: seq[string]; variables: untyped;
helpMessage: static[string] = ""; sepa: static[char] = '=';
prefix: static[char] = '-'; useEnvVars: static[bool] = false)">getOpt(source: seq[string]; variables: untyped;
helpMessage: static[string] = ""; sepa: static[char] = '=';
prefix: static[char] = '-'; useEnvVars: static[bool] = false)</a></li>
</ul>
</ul>
</details>
</li>
</ul>
</div>
<div class="nine columns" id="content">
<div id="tocRoot"></div>
<p class="module-desc"><img src="https://raw.githubusercontent.com/juancarlospaco/cliche/nim/cliche-banner.jpg"/>
<p><strong class="examples_text">Example:</strong></p>
<pre class="listing"><span class="Keyword">import</span> <span class="Identifier">src</span><span class="Operator">/</span><span class="Identifier">cliche</span>
<span class="Keyword">import</span> <span class="Identifier">std</span><span class="Operator">/</span><span class="Identifier">strutils</span>
<span class="Comment"># Use https://nim-lang.github.io/Nim/os.html#commandLineParams</span>
<span class="Keyword">block</span><span class="Punctuation">:</span>
<span class="Keyword">type</span> <span class="Identifier">Food</span> <span class="Operator">=</span> <span class="Keyword">enum</span> <span class="Identifier">PIZZA</span><span class="Punctuation">,</span> <span class="Identifier">TACO</span> <span class="Comment"># Enum from CLI.</span>
<span class="Comment"># let real = commandLineParams()</span>
<span class="Keyword">let</span> <span class="Identifier">fake</span> <span class="Operator">=</span> <span class="Operator">@</span><span class="Punctuation">[</span><span class="StringLit">"--a=1"</span><span class="Punctuation">,</span> <span class="StringLit">"--v_1=9.9"</span><span class="Punctuation">,</span> <span class="StringLit">"--v2=1"</span><span class="Punctuation">,</span> <span class="StringLit">"--v3=2"</span><span class="Punctuation">,</span> <span class="StringLit">"--v4=X"</span><span class="Punctuation">,</span> <span class="StringLit">"--v5=t"</span><span class="Punctuation">,</span> <span class="StringLit">"--v6=z"</span><span class="Punctuation">,</span> <span class="StringLit">"--v7=true"</span><span class="Punctuation">,</span> <span class="StringLit">"--food=PIZZA"</span><span class="Punctuation">,</span> <span class="StringLit">"--help"</span><span class="Punctuation">]</span>
<span class="Identifier">fake</span><span class="Operator">.</span><span class="Identifier">getOpt</span> <span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">:</span> <span class="Identifier">int</span><span class="Operator">.</span><span class="Identifier">high</span><span class="Punctuation">,</span> <span class="Identifier">v_1</span><span class="Punctuation">:</span> <span class="FloatNumber">3.14</span><span class="Punctuation">,</span> <span class="Identifier">v2</span><span class="Punctuation">:</span> <span class="DecNumber">9'</span><span class="Identifier">u64</span><span class="Punctuation">,</span> <span class="Identifier">v3</span><span class="Punctuation">:</span> <span class="Operator">-</span><span class="DecNumber">9'i64</span><span class="Punctuation">,</span> <span class="Identifier">v4</span><span class="Punctuation">:</span> <span class="StringLit">"a"</span><span class="Punctuation">,</span> <span class="Identifier">v5</span><span class="Punctuation">:</span> <span class="CharLit">'4'</span><span class="Punctuation">,</span> <span class="Identifier">v6</span><span class="Punctuation">:</span> <span class="RawData">cstring"b"</span><span class="Punctuation">,</span> <span class="Identifier">v7</span><span class="Punctuation">:</span> <span class="Identifier">false</span><span class="Punctuation">,</span> <span class="Identifier">missing</span><span class="Punctuation">:</span> <span class="DecNumber">42</span><span class="Punctuation">,</span> <span class="Identifier">food</span><span class="Punctuation">:</span> <span class="Identifier">TACO</span><span class="Punctuation">)</span>
<span class="Identifier">doAssert</span> <span class="Identifier">a</span> <span class="Operator">==</span> <span class="DecNumber">1</span>
<span class="Identifier">doAssert</span> <span class="Identifier">v_1</span> <span class="Operator">==</span> <span class="FloatNumber">9.9</span>
<span class="Identifier">doAssert</span> <span class="Identifier">v2</span> <span class="Operator">==</span> <span class="DecNumber">1'</span><span class="Identifier">u64</span>
<span class="Identifier">doAssert</span> <span class="Identifier">v3</span> <span class="Operator">==</span> <span class="DecNumber">2'i64</span>
<span class="Identifier">doAssert</span> <span class="Identifier">v4</span> <span class="Operator">==</span> <span class="StringLit">"X"</span>
<span class="Identifier">doAssert</span> <span class="Identifier">v5</span> <span class="Operator">==</span> <span class="CharLit">'t'</span>
<span class="Identifier">doAssert</span> <span class="Identifier">v6</span> <span class="Operator">==</span> <span class="RawData">cstring"z"</span>
<span class="Identifier">doAssert</span> <span class="Identifier">v7</span> <span class="Operator">==</span> <span class="Identifier">true</span>
<span class="Identifier">doAssert</span> <span class="Identifier">missing</span> <span class="Operator">==</span> <span class="DecNumber">42</span> <span class="Comment"># missing is not in fake, fallback to default value 42.</span>
<span class="Identifier">doAssert</span> <span class="Identifier">food</span> <span class="Keyword">is</span> <span class="Identifier">Food</span> <span class="Keyword">and</span> <span class="Identifier">food</span> <span class="Operator">==</span> <span class="Identifier">PIZZA</span> <span class="Comment"># food is Food.PIZZA</span>
<span class="Keyword">block</span><span class="Punctuation">:</span>
<span class="Keyword">let</span> <span class="Identifier">fake</span> <span class="Operator">=</span> <span class="Operator">@</span><span class="Punctuation">[</span><span class="StringLit">"--a=false"</span><span class="Punctuation">,</span> <span class="StringLit">"--b=5"</span><span class="Punctuation">,</span> <span class="StringLit">"--c=1"</span><span class="Punctuation">,</span> <span class="StringLit">"--d=2.0"</span><span class="Punctuation">,</span> <span class="StringLit">"--e=3"</span><span class="Punctuation">,</span> <span class="StringLit">"--f=128"</span><span class="Punctuation">]</span>
<span class="Identifier">fake</span><span class="Operator">.</span><span class="Identifier">getOpt</span> <span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">:</span> <span class="Identifier">true</span><span class="Punctuation">,</span> <span class="Identifier">b</span><span class="Punctuation">:</span> <span class="FloatNumber">9.</span><span class="Identifier">Positive</span><span class="Punctuation">,</span> <span class="Identifier">c</span><span class="Punctuation">:</span> <span class="FloatNumber">5.</span><span class="Identifier">cint</span><span class="Punctuation">,</span> <span class="Identifier">d</span><span class="Punctuation">:</span> <span class="FloatNumber">0.0</span><span class="Operator">.</span><span class="Identifier">float32</span><span class="Punctuation">,</span> <span class="Identifier">e</span><span class="Punctuation">:</span> <span class="FloatNumber">0.</span><span class="Identifier">Natural</span><span class="Punctuation">,</span> <span class="Identifier">f</span><span class="Punctuation">:</span> <span class="FloatNumber">255.</span><span class="Identifier">byte</span><span class="Punctuation">)</span>
<span class="Identifier">doAssert</span> <span class="Identifier">a</span> <span class="Operator">==</span> <span class="Identifier">false</span>
<span class="Identifier">doAssert</span> <span class="Identifier">b</span> <span class="Operator">==</span> <span class="FloatNumber">5.</span><span class="Identifier">Positive</span>
<span class="Identifier">doAssert</span> <span class="Identifier">c</span> <span class="Operator">==</span> <span class="FloatNumber">1.</span><span class="Identifier">cint</span>
<span class="Identifier">doAssert</span> <span class="Identifier">d</span> <span class="Operator">==</span> <span class="FloatNumber">2.0</span><span class="Operator">.</span><span class="Identifier">float32</span>
<span class="Identifier">doAssert</span> <span class="Identifier">e</span> <span class="Operator">==</span> <span class="FloatNumber">3.</span><span class="Identifier">Natural</span>
<span class="Identifier">doAssert</span> <span class="Identifier">f</span> <span class="Operator">==</span> <span class="FloatNumber">128.</span><span class="Identifier">byte</span></pre><ul class="simple"><li>Auto-Generated <tt class="docutils literal"><span class="pre"><span class="Operator">--</span><span class="Identifier">help</span></span></tt> (Can be parsed as TSV):</li>
</ul>
<pre class="listing"><span class="Operator">$</span> <span class="Identifier">example</span> <span class="Operator">--</span><span class="Identifier">help</span>
<span class="Identifier">key</span> <span class="Keyword">type</span> <span class="Identifier">default</span>
<span class="Operator">--</span><span class="Identifier">a</span><span class="Operator">=</span> <span class="Identifier">int</span> <span class="Identifier">int</span><span class="Operator">.</span><span class="Identifier">high</span>
<span class="Operator">--</span><span class="Identifier">v_1</span><span class="Operator">=</span> <span class="Identifier">float</span> <span class="FloatNumber">3.14</span>
<span class="Operator">--</span><span class="Identifier">v2</span><span class="Operator">=</span> <span class="Identifier">uint</span> <span class="DecNumber">9'</span><span class="Identifier">u64</span>
<span class="Operator">--</span><span class="Identifier">v3</span><span class="Operator">=</span> <span class="Identifier">int</span> <span class="Operator">-</span><span class="DecNumber">9'i64</span>
<span class="Operator">--</span><span class="Identifier">v4</span><span class="Operator">=</span> <span class="Identifier">string</span> <span class="StringLit">"a"</span>
<span class="Operator">--</span><span class="Identifier">v5</span><span class="Operator">=</span> <span class="Identifier">char</span> <span class="CharLit">'4'</span>
<span class="Operator">--</span><span class="Identifier">v6</span><span class="Operator">=</span> <span class="Identifier">string</span> <span class="RawData">cstring"b"</span>
<span class="Operator">--</span><span class="Identifier">missing</span><span class="Operator">=</span> <span class="Identifier">int</span> <span class="DecNumber">42</span>
<span class="Operator">--</span><span class="Identifier">help</span> <span class="Operator">?</span> <span class="Identifier">Some</span> <span class="Identifier">Help</span> <span class="Identifier">Message</span> <span class="Identifier">Here</span><span class="Operator">!</span></pre></p>
<div class="section" id="17">
<h1><a class="toc-backref" href="#17">Macros</a></h1>
<dl class="item">
<div id="getOpt-macros-all">
<div id="getOpt.m,seq[string],untyped,static[string],static[char],static[char],static[bool]">
<dt><pre><span class="Keyword">macro</span> <a href="#getOpt.m%2Cseq%5Bstring%5D%2Cuntyped%2Cstatic%5Bstring%5D%2Cstatic%5Bchar%5D%2Cstatic%5Bchar%5D%2Cstatic%5Bbool%5D"><span class="Identifier">getOpt</span></a><span class="Other">(</span><span class="Identifier">source</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">string</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">variables</span><span class="Other">:</span> <span class="Identifier">untyped</span><span class="Other">;</span>
<span class="Identifier">helpMessage</span><span class="Other">:</span> <span class="Identifier">static</span><span class="Other">[</span><span class="Identifier">string</span><span class="Other">]</span> <span class="Other">=</span> <span class="StringLit">""</span><span class="Other">;</span> <span class="Identifier">sepa</span><span class="Other">:</span> <span class="Identifier">static</span><span class="Other">[</span><span class="Identifier">char</span><span class="Other">]</span> <span class="Other">=</span> <span class="CharLit">'='</span><span class="Other">;</span>
<span class="Identifier">prefix</span><span class="Other">:</span> <span class="Identifier">static</span><span class="Other">[</span><span class="Identifier">char</span><span class="Other">]</span> <span class="Other">=</span> <span class="CharLit">'-'</span><span class="Other">;</span> <span class="Identifier">useEnvVars</span><span class="Other">:</span> <span class="Identifier">static</span><span class="Other">[</span><span class="Identifier">bool</span><span class="Other">]</span> <span class="Other">=</span> <span class="Identifier">false</span><span class="Other">)</span></pre></dt>
<dd>
</dd>
</div>
</div>
</dl>
</div>
</div>
</div>
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br>
<small style="color: var(--hint);">Made with Nim. Generated: 2022-11-19 15:09:31 UTC</small>
</div>
</div>
</div>
<!-- Google fonts -->
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
</body>
</html>