rbcli 0.2.12 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/Gemfile.lock +39 -38
  4. data/docs-src/content/development/changelog.md +16 -1
  5. data/docs-src/themes/hugo-theme-learn/CHANGELOG.md +74 -2
  6. data/docs-src/themes/hugo-theme-learn/README.md +42 -5
  7. data/docs-src/themes/hugo-theme-learn/exampleSite/config.toml +27 -0
  8. data/docs-src/themes/hugo-theme-learn/exampleSite/content/basics/_index.zh.md +12 -0
  9. data/docs-src/themes/hugo-theme-learn/exampleSite/content/basics/configuration/_index.en.md +6 -4
  10. data/docs-src/themes/hugo-theme-learn/exampleSite/content/basics/configuration/_index.fr.md +7 -5
  11. data/docs-src/themes/hugo-theme-learn/exampleSite/content/basics/installation/_index.en.md +1 -1
  12. data/docs-src/themes/hugo-theme-learn/exampleSite/content/cont/markdown.en.md +88 -61
  13. data/docs-src/themes/hugo-theme-learn/exampleSite/content/cont/pages/_index.fr.md +3 -3
  14. data/docs-src/themes/hugo-theme-learn/exampleSite/content/cont/syntaxhighlight.en.md +89 -0
  15. data/docs-src/themes/hugo-theme-learn/exampleSite/content/shortcodes/children/_index.en.md +2 -2
  16. data/docs-src/themes/hugo-theme-learn/exampleSite/content/shortcodes/notice.en.md +2 -2
  17. data/docs-src/themes/hugo-theme-learn/exampleSite/content/showcase.en.md +4 -1
  18. data/docs-src/themes/hugo-theme-learn/exampleSite/content/showcase.fr.md +4 -1
  19. data/docs-src/themes/hugo-theme-learn/exampleSite/static/fonts/monogramos-webfont.svg +1 -237
  20. data/docs-src/themes/hugo-theme-learn/exampleSite/static/images/showcase/inteliver_docs.png +0 -0
  21. data/docs-src/themes/hugo-theme-learn/exampleSite/static/images/showcase/tshark_dev.png +0 -0
  22. data/docs-src/themes/hugo-theme-learn/i18n/ar.toml +26 -0
  23. data/docs-src/themes/hugo-theme-learn/i18n/de.toml +26 -0
  24. data/docs-src/themes/hugo-theme-learn/i18n/hi.toml +26 -0
  25. data/docs-src/themes/hugo-theme-learn/i18n/ja.toml +26 -0
  26. data/docs-src/themes/hugo-theme-learn/i18n/ru.toml +26 -0
  27. data/docs-src/themes/hugo-theme-learn/i18n/zh-cn.toml +26 -0
  28. data/docs-src/themes/hugo-theme-learn/layouts/_default/list.html +1 -1
  29. data/docs-src/themes/hugo-theme-learn/layouts/_default/single.html +1 -2
  30. data/docs-src/themes/hugo-theme-learn/layouts/partials/footer.html +3 -4
  31. data/docs-src/themes/hugo-theme-learn/layouts/partials/header.html +8 -6
  32. data/docs-src/themes/hugo-theme-learn/layouts/partials/menu.html +6 -5
  33. data/docs-src/themes/hugo-theme-learn/layouts/shortcodes/children.html +2 -2
  34. data/docs-src/themes/hugo-theme-learn/layouts/shortcodes/ref.html +1 -1
  35. data/docs-src/themes/hugo-theme-learn/layouts/shortcodes/relref.html +1 -1
  36. data/docs-src/themes/hugo-theme-learn/netlify.toml +1 -2
  37. data/docs-src/themes/hugo-theme-learn/static/css/theme.css +4 -0
  38. data/docs-src/themes/hugo-theme-learn/static/fonts/Inconsolata.svg +1 -359
  39. data/docs-src/themes/hugo-theme-learn/static/fonts/Novecentosanswide-Normal-webfont.svg +1 -1019
  40. data/docs-src/themes/hugo-theme-learn/static/fonts/Novecentosanswide-UltraLight-webfont.svg +1 -918
  41. data/docs-src/themes/hugo-theme-learn/static/fonts/Work_Sans_200.svg +1 -332
  42. data/docs-src/themes/hugo-theme-learn/static/fonts/Work_Sans_300.svg +1 -331
  43. data/docs-src/themes/hugo-theme-learn/static/fonts/Work_Sans_500.svg +1 -333
  44. data/docs-src/themes/hugo-theme-learn/static/images/clippy.svg +1 -1
  45. data/docs-src/themes/hugo-theme-learn/static/js/auto-complete.js +3 -223
  46. data/docs-src/themes/hugo-theme-learn/static/js/highlight.pack.js +6 -3
  47. data/docs-src/themes/hugo-theme-learn/static/js/hugo-learn.js +8 -5
  48. data/docs-src/themes/hugo-theme-learn/static/webfonts/fa-brands-400.svg +1 -1260
  49. data/docs-src/themes/hugo-theme-learn/static/webfonts/fa-regular-400.svg +1 -471
  50. data/docs-src/themes/hugo-theme-learn/static/webfonts/fa-solid-900.svg +1 -2763
  51. data/docs/404.html +8 -8
  52. data/docs/advanced/automatic_updates/index.html +85 -65
  53. data/docs/advanced/command_types/index.html +139 -144
  54. data/docs/advanced/distributed_state_locking/index.html +83 -55
  55. data/docs/advanced/hooks/index.html +94 -81
  56. data/docs/advanced/index.html +75 -34
  57. data/docs/advanced/index.xml +8 -8
  58. data/docs/advanced/interactive_commands/index.html +90 -66
  59. data/docs/advanced/logging/index.html +94 -67
  60. data/docs/advanced/remote_execution/index.html +94 -75
  61. data/docs/advanced/state_storage/index.html +122 -119
  62. data/docs/advanced/user_config_files/index.html +94 -71
  63. data/docs/categories/index.html +82 -30
  64. data/docs/categories/index.xml +1 -1
  65. data/docs/css/theme.css +4 -0
  66. data/docs/development/changelog/index.html +185 -177
  67. data/docs/development/code_of_conduct/index.html +85 -64
  68. data/docs/development/contributing/index.html +96 -96
  69. data/docs/development/index.html +75 -34
  70. data/docs/development/index.xml +2 -2
  71. data/docs/development/license/index.html +80 -46
  72. data/docs/fonts/Inconsolata.svg +1 -359
  73. data/docs/fonts/Novecentosanswide-Normal-webfont.svg +1 -1019
  74. data/docs/fonts/Novecentosanswide-UltraLight-webfont.svg +1 -918
  75. data/docs/fonts/Work_Sans_200.svg +1 -332
  76. data/docs/fonts/Work_Sans_300.svg +1 -331
  77. data/docs/fonts/Work_Sans_500.svg +1 -333
  78. data/docs/images/clippy.svg +1 -1
  79. data/docs/index.html +112 -61
  80. data/docs/index.json +24 -24
  81. data/docs/index.xml +13 -13
  82. data/docs/js/auto-complete.js +3 -223
  83. data/docs/js/highlight.pack.js +6 -3
  84. data/docs/js/hugo-learn.js +8 -5
  85. data/docs/quick_reference/index.html +126 -159
  86. data/docs/quick_reference/index.xml +1 -1
  87. data/docs/sitemap.xml +2 -4
  88. data/docs/tags/index.html +82 -30
  89. data/docs/tags/index.xml +1 -1
  90. data/docs/tutorial/10-getting_started/index.html +87 -66
  91. data/docs/tutorial/20-project_layout/index.html +126 -116
  92. data/docs/tutorial/30-your_first_command/index.html +151 -141
  93. data/docs/tutorial/40-options_parameters_and_arguments/index.html +233 -258
  94. data/docs/tutorial/50-publishing/index.html +86 -66
  95. data/docs/tutorial/index.html +75 -34
  96. data/docs/tutorial/index.xml +4 -4
  97. data/docs/webfonts/fa-brands-400.svg +1 -1260
  98. data/docs/webfonts/fa-regular-400.svg +1 -471
  99. data/docs/webfonts/fa-solid-900.svg +1 -2763
  100. data/docs/whoami/index.html +76 -46
  101. data/docs/whoami/index.xml +1 -1
  102. data/lib/rbcli/configuration/configurate_blocks/me.rb +5 -5
  103. data/lib/rbcli/util/deprecation_warning.rb +21 -4
  104. data/lib/rbcli/version.rb +1 -1
  105. data/rbcli.gemspec +8 -8
  106. data/skeletons/project/Gemfile +1 -1
  107. data/skeletons/project/config/general.rb +1 -1
  108. data/skeletons/project/lib/lib.erb +2 -0
  109. data/skeletons/project/spec/spec_helper.rb +7 -7
  110. data/skeletons/project/spec/untitled_spec.rb +6 -6
  111. data/skeletons/project/untitled.gemspec +28 -26
  112. metadata +29 -20
  113. data/docs-src/themes/hugo-theme-learn/static/js/html5shiv-printshiv.min.js +0 -4
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <meta name="generator" content="Hugo 0.55.6" />
6
+ <meta name="generator" content="Hugo 0.74.3" />
7
7
  <meta name="description" content="">
8
8
 
9
9
 
@@ -12,20 +12,21 @@
12
12
  <title>Options, Parameters, and Arguments :: RBCli Documentation</title>
13
13
 
14
14
 
15
- <link href="/rbcli/css/nucleus.css?1561087612" rel="stylesheet">
16
- <link href="/rbcli/css/fontawesome-all.min.css?1561087612" rel="stylesheet">
17
- <link href="/rbcli/css/hybrid.css?1561087612" rel="stylesheet">
18
- <link href="/rbcli/css/featherlight.min.css?1561087612" rel="stylesheet">
19
- <link href="/rbcli/css/perfect-scrollbar.min.css?1561087612" rel="stylesheet">
20
- <link href="/rbcli/css/auto-complete.css?1561087612" rel="stylesheet">
21
- <link href="/rbcli/css/atom-one-dark-reasonable.css?1561087612" rel="stylesheet">
22
- <link href="/rbcli/css/theme.css?1561087612" rel="stylesheet">
23
- <link href="/rbcli/css/hugo-theme.css?1561087612" rel="stylesheet">
15
+ <link href="/rbcli/css/nucleus.css?1596148729" rel="stylesheet">
16
+ <link href="/rbcli/css/fontawesome-all.min.css?1596148729" rel="stylesheet">
17
+ <link href="/rbcli/css/hybrid.css?1596148729" rel="stylesheet">
18
+ <link href="/rbcli/css/featherlight.min.css?1596148729" rel="stylesheet">
19
+ <link href="/rbcli/css/perfect-scrollbar.min.css?1596148729" rel="stylesheet">
20
+ <link href="/rbcli/css/auto-complete.css?1596148729" rel="stylesheet">
21
+ <link href="/rbcli/css/atom-one-dark-reasonable.css?1596148729" rel="stylesheet">
22
+ <link href="/rbcli/css/theme.css?1596148729" rel="stylesheet">
23
+ <link href="/rbcli/css/hugo-theme.css?1596148729" rel="stylesheet">
24
+
25
+ <link href="/rbcli/css/theme-blue.css?1596148729" rel="stylesheet">
24
26
 
25
- <link href="/rbcli/css/theme-blue.css?1561087612" rel="stylesheet">
26
27
 
27
28
 
28
- <script src="/rbcli/js/jquery-3.3.1.min.js?1561087612"></script>
29
+ <script src="/rbcli/js/jquery-3.3.1.min.js?1596148729"></script>
29
30
 
30
31
  <style>
31
32
  :root #header + #content > #left > #rlblock_left{
@@ -54,14 +55,14 @@
54
55
  <span data-search-clear=""><i class="fas fa-times"></i></span>
55
56
  </div>
56
57
 
57
- <script type="text/javascript" src="/rbcli/js/lunr.min.js?1561087612"></script>
58
- <script type="text/javascript" src="/rbcli/js/auto-complete.js?1561087612"></script>
58
+ <script type="text/javascript" src="/rbcli/js/lunr.min.js?1596148729"></script>
59
+ <script type="text/javascript" src="/rbcli/js/auto-complete.js?1596148729"></script>
59
60
  <script type="text/javascript">
60
61
 
61
62
  var baseurl = "https:\/\/akhoury6.github.io\/rbcli\/";
62
63
 
63
64
  </script>
64
- <script type="text/javascript" src="/rbcli/js/search.js?1561087612"></script>
65
+ <script type="text/javascript" src="/rbcli/js/search.js?1596148729"></script>
65
66
 
66
67
 
67
68
  </div>
@@ -74,6 +75,8 @@
74
75
 
75
76
 
76
77
 
78
+
79
+
77
80
 
78
81
 
79
82
 
@@ -96,6 +99,8 @@
96
99
 
97
100
 
98
101
 
102
+
103
+
99
104
 
100
105
 
101
106
 
@@ -121,6 +126,8 @@
121
126
 
122
127
 
123
128
 
129
+
130
+
124
131
 
125
132
 
126
133
 
@@ -140,6 +147,8 @@
140
147
 
141
148
 
142
149
 
150
+
151
+
143
152
 
144
153
 
145
154
 
@@ -159,6 +168,8 @@
159
168
 
160
169
 
161
170
 
171
+
172
+
162
173
 
163
174
 
164
175
 
@@ -178,6 +189,8 @@
178
189
 
179
190
 
180
191
 
192
+
193
+
181
194
 
182
195
 
183
196
 
@@ -197,6 +210,8 @@
197
210
 
198
211
 
199
212
 
213
+
214
+
200
215
 
201
216
 
202
217
 
@@ -223,6 +238,8 @@
223
238
 
224
239
 
225
240
 
241
+
242
+
226
243
 
227
244
 
228
245
 
@@ -248,6 +265,8 @@
248
265
 
249
266
 
250
267
 
268
+
269
+
251
270
 
252
271
 
253
272
 
@@ -267,6 +286,8 @@
267
286
 
268
287
 
269
288
 
289
+
290
+
270
291
 
271
292
 
272
293
 
@@ -286,6 +307,8 @@
286
307
 
287
308
 
288
309
 
310
+
311
+
289
312
 
290
313
 
291
314
 
@@ -305,6 +328,8 @@
305
328
 
306
329
 
307
330
 
331
+
332
+
308
333
 
309
334
 
310
335
 
@@ -324,6 +349,8 @@
324
349
 
325
350
 
326
351
 
352
+
353
+
327
354
 
328
355
 
329
356
 
@@ -343,6 +370,8 @@
343
370
 
344
371
 
345
372
 
373
+
374
+
346
375
 
347
376
 
348
377
 
@@ -362,6 +391,8 @@
362
391
 
363
392
 
364
393
 
394
+
395
+
365
396
 
366
397
 
367
398
 
@@ -381,6 +412,8 @@
381
412
 
382
413
 
383
414
 
415
+
416
+
384
417
 
385
418
 
386
419
 
@@ -400,6 +433,8 @@
400
433
 
401
434
 
402
435
 
436
+
437
+
403
438
 
404
439
 
405
440
 
@@ -426,6 +461,8 @@
426
461
 
427
462
 
428
463
 
464
+
465
+
429
466
 
430
467
 
431
468
 
@@ -451,6 +488,8 @@
451
488
 
452
489
 
453
490
 
491
+
492
+
454
493
 
455
494
 
456
495
 
@@ -470,6 +509,8 @@
470
509
 
471
510
 
472
511
 
512
+
513
+
473
514
 
474
515
 
475
516
 
@@ -489,6 +530,8 @@
489
530
 
490
531
 
491
532
 
533
+
534
+
492
535
 
493
536
 
494
537
 
@@ -508,6 +551,8 @@
508
551
 
509
552
 
510
553
 
554
+
555
+
511
556
 
512
557
 
513
558
 
@@ -534,6 +579,8 @@
534
579
 
535
580
 
536
581
 
582
+
583
+
537
584
 
538
585
 
539
586
 
@@ -585,7 +632,6 @@
585
632
 
586
633
 
587
634
 
588
-
589
635
  <section id="body">
590
636
  <div id="overlay"></div>
591
637
  <div class="padding highlightable">
@@ -619,9 +665,9 @@
619
665
 
620
666
  <a href='/rbcli/'></a> > <a href='/rbcli/tutorial/'>Tutorial</a> > Options, Parameters, and Arguments
621
667
 
622
-
668
+
623
669
 
624
-
670
+
625
671
 
626
672
 
627
673
 
@@ -631,20 +677,18 @@
631
677
  <div class="progress">
632
678
  <div class="wrapper">
633
679
  <nav id="TableOfContents">
634
- <ul>
635
- <li>
636
- <ul>
637
- <li><a href="#command-line-structure">Command Line Structure</a></li>
638
- <li><a href="#options">Options</a></li>
639
- <li><a href="#parameters">Parameters</a>
640
- <ul>
641
- <li><a href="#user-prompting">User Prompting</a></li>
642
- </ul></li>
643
- <li><a href="#arguments">Arguments</a></li>
644
- <li><a href="#simplified-reference-tldr">Simplified Reference (TLDR)</a></li>
645
- <li><a href="#next-steps">Next Steps</a></li>
646
- </ul></li>
647
- </ul>
680
+ <ul>
681
+ <li><a href="#command-line-structure">Command Line Structure</a></li>
682
+ <li><a href="#options">Options</a></li>
683
+ <li><a href="#parameters">Parameters</a>
684
+ <ul>
685
+ <li><a href="#user-prompting">User Prompting</a></li>
686
+ </ul>
687
+ </li>
688
+ <li><a href="#arguments">Arguments</a></li>
689
+ <li><a href="#simplified-reference-tldr">Simplified Reference (TLDR)</a></li>
690
+ <li><a href="#next-steps">Next Steps</a></li>
691
+ </ul>
648
692
  </nav>
649
693
  </div>
650
694
  </div>
@@ -668,296 +712,228 @@
668
712
 
669
713
 
670
714
 
671
-
672
-
673
-
674
715
  <p>If you&rsquo;re already an experienced coder, you can jump to the last section of this document, the <a href="#simplified-reference-tldr">Simplified Reference (TLDR)</a></p>
675
-
676
716
  <h2 id="command-line-structure">Command Line Structure</h2>
677
-
678
717
  <p>In the previous section, you saw two parts of the RBCli command line structure - the executable followed by the command. However, RBCli is capable of more complex interaction. The structure is as follows:</p>
679
-
680
718
  <pre><code>toolname [options] command [parameters] argument1 argument2...
681
- </code></pre>
682
-
683
- <ul>
719
+ </code></pre><ul>
684
720
  <li><strong>Options</strong> are command line parameters such as <code>-f</code>, or <code>--force</code>. These are available globally to every command. You can create your own, though several are already built-in and reserved for RBCli:
685
-
686
721
  <ul>
687
722
  <li><code>--config-file=&lt;filename&gt;</code> allows specifying a config file location manually.</li>
688
723
  <li><code>--generate-config</code> generates a config file for the user by writing out the defaults to a YAML file. This option will only appear if a config file has been set. The location is configurable, with more on that in the documentation on <a href="/rbcli/advanced/user_config_files/">User Config Files</a>).</li>
689
724
  <li><code>-v / --version</code> shows the version.</li>
690
725
  <li><code>-h / --help</code> shows the help.</li>
691
- </ul></li>
726
+ </ul>
727
+ </li>
692
728
  <li><strong>Command</strong> represents the subcommands that you will create, such as <code>list</code>, <code>test</code>, or <code>apply</code>.</li>
693
729
  <li><strong>Parameters</strong> are the same as options, but only apply to the specific subcommand being executed. In this case only the <code>-h / --help</code> parameter is provided automatically.</li>
694
730
  <li><strong>Arguments</strong> are strings that don&rsquo;t begin with a &lsquo;-&rsquo;, and are passed to the command&rsquo;s code as an array. These can be used as subcommands or additional parameters for your command.</li>
695
731
  </ul>
696
-
697
732
  <p>So a valid command could look something like these:</p>
698
-
699
- <pre><code class="language-shell">mytool -n load --filename=foo.txt
733
+ <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">mytool -n load --filename<span style="color:#f92672">=</span>foo.txt
700
734
  mytool parse foo.txt
701
735
  mytool show -l
702
- </code></pre>
703
-
704
- <p>Note that all options and parameters will have both a short and long version of the parameter available for use.</p>
705
-
736
+ </code></pre></div><p>Note that all options and parameters will have both a short and long version of the parameter available for use.</p>
706
737
  <p>So let&rsquo;s take a look at how we define them.</p>
707
-
708
738
  <h2 id="options">Options</h2>
709
-
710
739
  <p>You can find the options declarations under <code>application/options.rb</code>. You&rsquo;ll see the example in the code:</p>
711
-
712
- <pre><code class="language-ruby">option :name, 'Give me your name', short: 'n', type: :string, default: 'Jack', required: false, permitted: ['Jack', 'Jill']
713
- </code></pre>
714
-
715
- <p>This won&rsquo;t do for our tool, so let&rsquo;s change it. Remember that these options will be applicable to all of our commands, so lets make it something appropriate:</p>
716
-
717
- <pre><code class="language-ruby">option :color, 'Enable color output', short: 'c', type: :boolean, default: false
718
- </code></pre>
719
-
720
- <p>So now, let&rsquo;s take advantage of this flag in our <code>list</code> command. Let&rsquo;s change our block to:</p>
721
-
722
- <pre><code class="language-ruby"> action do |params, args, global_opts, config|
723
- Dir.glob &quot;./*&quot; do |filename|
724
- outname = filename.split('/')[1]
725
- outname += '/' if File.directory? filename
726
-
727
- # We change the color based on the kind of file shown
728
- if global_opts[:color]
729
- if File.directory? filename
730
- outname = outname.light_blue
731
- elsif File.executable? filename
732
- outname = outname.light_green
733
- end
734
- end
740
+ <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-ruby" data-lang="ruby">option <span style="color:#e6db74">:name</span>, <span style="color:#e6db74">&#39;Give me your name&#39;</span>, <span style="color:#e6db74">short</span>: <span style="color:#e6db74">&#39;n&#39;</span>, <span style="color:#e6db74">type</span>: <span style="color:#e6db74">:string</span>, <span style="color:#e6db74">default</span>: <span style="color:#e6db74">&#39;Jack&#39;</span>, <span style="color:#e6db74">required</span>: <span style="color:#66d9ef">false</span>, <span style="color:#e6db74">permitted</span>: <span style="color:#f92672">[</span><span style="color:#e6db74">&#39;Jack&#39;</span>, <span style="color:#e6db74">&#39;Jill&#39;</span><span style="color:#f92672">]</span>
741
+ </code></pre></div><p>This won&rsquo;t do for our tool, so let&rsquo;s change it. Remember that these options will be applicable to all of our commands, so lets make it something appropriate:</p>
742
+ <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-ruby" data-lang="ruby">option <span style="color:#e6db74">:color</span>, <span style="color:#e6db74">&#39;Enable color output&#39;</span>, <span style="color:#e6db74">short</span>: <span style="color:#e6db74">&#39;c&#39;</span>, <span style="color:#e6db74">type</span>: <span style="color:#e6db74">:boolean</span>, <span style="color:#e6db74">default</span>: <span style="color:#66d9ef">false</span>
743
+ </code></pre></div><p>So now, let&rsquo;s take advantage of this flag in our <code>list</code> command. Let&rsquo;s change our block to:</p>
744
+ <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-ruby" data-lang="ruby"> action <span style="color:#66d9ef">do</span> <span style="color:#f92672">|</span>params, args, global_opts, config<span style="color:#f92672">|</span>
745
+ <span style="color:#66d9ef">Dir</span><span style="color:#f92672">.</span>glob <span style="color:#e6db74">&#34;./*&#34;</span> <span style="color:#66d9ef">do</span> <span style="color:#f92672">|</span>filename<span style="color:#f92672">|</span>
746
+ outname <span style="color:#f92672">=</span> filename<span style="color:#f92672">.</span>split(<span style="color:#e6db74">&#39;/&#39;</span>)<span style="color:#f92672">[</span><span style="color:#ae81ff">1</span><span style="color:#f92672">]</span>
747
+ outname <span style="color:#f92672">+=</span> <span style="color:#e6db74">&#39;/&#39;</span> <span style="color:#66d9ef">if</span> <span style="color:#66d9ef">File</span><span style="color:#f92672">.</span>directory? filename
748
+
749
+ <span style="color:#75715e"># We change the color based on the kind of file shown</span>
750
+ <span style="color:#66d9ef">if</span> global_opts<span style="color:#f92672">[</span><span style="color:#e6db74">:color</span><span style="color:#f92672">]</span>
751
+ <span style="color:#66d9ef">if</span> <span style="color:#66d9ef">File</span><span style="color:#f92672">.</span>directory? filename
752
+ outname <span style="color:#f92672">=</span> outname<span style="color:#f92672">.</span>light_blue
753
+ <span style="color:#66d9ef">elsif</span> <span style="color:#66d9ef">File</span><span style="color:#f92672">.</span>executable? filename
754
+ outname <span style="color:#f92672">=</span> outname<span style="color:#f92672">.</span>light_green
755
+ <span style="color:#66d9ef">end</span>
756
+ <span style="color:#66d9ef">end</span>
735
757
 
736
758
  puts outname
737
- end
738
- end
739
- </code></pre>
740
-
741
- <p>Notice how we referenced the value by using <code>global_opts[:color]</code>. It&rsquo;s that simple. To see it in action, run:</p>
742
-
743
- <pre><code class="language-bash">mytool -c list
744
- </code></pre>
745
-
746
- <h2 id="parameters">Parameters</h2>
747
-
759
+ <span style="color:#66d9ef">end</span>
760
+ <span style="color:#66d9ef">end</span>
761
+ </code></pre></div><p>Notice how we referenced the value by using <code>global_opts[:color]</code>. It&rsquo;s that simple. To see it in action, run:</p>
762
+ <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">mytool -c list
763
+ </code></pre></div><h2 id="parameters">Parameters</h2>
748
764
  <p>Parameters work the same way as options, but they are localized to only the selected command. They are declared - as you probably guessed by now - in the command&rsquo;s class. So let&rsquo;s add the following lines to our list command within the class declaration:</p>
749
-
750
- <pre><code class="language-ruby">parameter :sort, 'Sort output alphabetically', type: :boolean, default: false
751
- parameter :all, 'Show hidden files', type: :boolean, default: false
752
- parameter :directoriesfirst, 'Show directories on top', type: :boolean, default: false
753
- </code></pre>
754
-
755
- <p>And let&rsquo;s modify our action block to utilize them:</p>
756
-
757
- <pre><code class="language-ruby"> action do |params, args, global_opts, config|
758
- filelist = []
759
-
760
- # We include dotfiles if specified
761
- include_dotfiles = (params[:all]) ? File::FNM_DOTMATCH : 0
765
+ <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-ruby" data-lang="ruby">parameter <span style="color:#e6db74">:sort</span>, <span style="color:#e6db74">&#39;Sort output alphabetically&#39;</span>, <span style="color:#e6db74">type</span>: <span style="color:#e6db74">:boolean</span>, <span style="color:#e6db74">default</span>: <span style="color:#66d9ef">false</span>
766
+ parameter <span style="color:#e6db74">:all</span>, <span style="color:#e6db74">&#39;Show hidden files&#39;</span>, <span style="color:#e6db74">type</span>: <span style="color:#e6db74">:boolean</span>, <span style="color:#e6db74">default</span>: <span style="color:#66d9ef">false</span>
767
+ parameter <span style="color:#e6db74">:directoriesfirst</span>, <span style="color:#e6db74">&#39;Show directories on top&#39;</span>, <span style="color:#e6db74">type</span>: <span style="color:#e6db74">:boolean</span>, <span style="color:#e6db74">default</span>: <span style="color:#66d9ef">false</span>
768
+ </code></pre></div><p>And let&rsquo;s modify our action block to utilize them:</p>
769
+ <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-ruby" data-lang="ruby"> action <span style="color:#66d9ef">do</span> <span style="color:#f92672">|</span>params, args, global_opts, config<span style="color:#f92672">|</span>
770
+ filelist <span style="color:#f92672">=</span> <span style="color:#f92672">[]</span>
771
+
772
+ <span style="color:#75715e"># We include dotfiles if specified</span>
773
+ include_dotfiles <span style="color:#f92672">=</span> (params<span style="color:#f92672">[</span><span style="color:#e6db74">:all</span><span style="color:#f92672">]</span>) ? <span style="color:#66d9ef">File</span><span style="color:#f92672">::</span><span style="color:#66d9ef">FNM_DOTMATCH</span> : <span style="color:#ae81ff">0</span>
762
774
 
763
- # We store a list of the files in an array, including dotfiles if specified
764
- Dir.glob &quot;./*&quot;, include_dotfiles do |filename|
765
- outname = filename.split('/')[1]
766
- outname += '/' if File.directory? filename
767
- filelist.append outname
768
- end
769
-
770
- # Sort alphabetically if specified
771
- filelist.sort! if params[:sort]
772
-
773
- # Put directories first if specified
774
- if params[:directoriesfirst]
775
- files = []; dirs = []
776
- filelist.each do |filename|
777
- if File.directory? filename
778
- dirs.append(filename)
779
- else
780
- files.append(filename)
781
- end
782
- end
783
- filelist = dirs + files
784
- end
775
+ <span style="color:#75715e"># We store a list of the files in an array, including dotfiles if specified</span>
776
+ <span style="color:#66d9ef">Dir</span><span style="color:#f92672">.</span>glob <span style="color:#e6db74">&#34;./*&#34;</span>, include_dotfiles <span style="color:#66d9ef">do</span> <span style="color:#f92672">|</span>filename<span style="color:#f92672">|</span>
777
+ outname <span style="color:#f92672">=</span> filename<span style="color:#f92672">.</span>split(<span style="color:#e6db74">&#39;/&#39;</span>)<span style="color:#f92672">[</span><span style="color:#ae81ff">1</span><span style="color:#f92672">]</span>
778
+ outname <span style="color:#f92672">+=</span> <span style="color:#e6db74">&#39;/&#39;</span> <span style="color:#66d9ef">if</span> <span style="color:#66d9ef">File</span><span style="color:#f92672">.</span>directory? filename
779
+ filelist<span style="color:#f92672">.</span>append outname
780
+ <span style="color:#66d9ef">end</span>
781
+
782
+ <span style="color:#75715e"># Sort alphabetically if specified</span>
783
+ filelist<span style="color:#f92672">.</span>sort! <span style="color:#66d9ef">if</span> params<span style="color:#f92672">[</span><span style="color:#e6db74">:sort</span><span style="color:#f92672">]</span>
784
+
785
+ <span style="color:#75715e"># Put directories first if specified</span>
786
+ <span style="color:#66d9ef">if</span> params<span style="color:#f92672">[</span><span style="color:#e6db74">:directoriesfirst</span><span style="color:#f92672">]</span>
787
+ files <span style="color:#f92672">=</span> <span style="color:#f92672">[]</span>; dirs <span style="color:#f92672">=</span> <span style="color:#f92672">[]</span>
788
+ filelist<span style="color:#f92672">.</span>each <span style="color:#66d9ef">do</span> <span style="color:#f92672">|</span>filename<span style="color:#f92672">|</span>
789
+ <span style="color:#66d9ef">if</span> <span style="color:#66d9ef">File</span><span style="color:#f92672">.</span>directory? filename
790
+ dirs<span style="color:#f92672">.</span>append(filename)
791
+ <span style="color:#66d9ef">else</span>
792
+ files<span style="color:#f92672">.</span>append(filename)
793
+ <span style="color:#66d9ef">end</span>
794
+ <span style="color:#66d9ef">end</span>
795
+ filelist <span style="color:#f92672">=</span> dirs <span style="color:#f92672">+</span> files
796
+ <span style="color:#66d9ef">end</span>
785
797
 
786
- # Apply color. We do this at the end now because color codes can alter the sorting.
787
- filelist.map! do |filename|
788
- if File.directory? filename
789
- filename.light_blue
790
- elsif File.executable? filename
791
- filename.light_green
792
- else
798
+ <span style="color:#75715e"># Apply color. We do this at the end now because color codes can alter the sorting.</span>
799
+ filelist<span style="color:#f92672">.</span>map! <span style="color:#66d9ef">do</span> <span style="color:#f92672">|</span>filename<span style="color:#f92672">|</span>
800
+ <span style="color:#66d9ef">if</span> <span style="color:#66d9ef">File</span><span style="color:#f92672">.</span>directory? filename
801
+ filename<span style="color:#f92672">.</span>light_blue
802
+ <span style="color:#66d9ef">elsif</span> <span style="color:#66d9ef">File</span><span style="color:#f92672">.</span>executable? filename
803
+ filename<span style="color:#f92672">.</span>light_green
804
+ <span style="color:#66d9ef">else</span>
793
805
  filename
794
- end
795
- end if global_opts[:color]
806
+ <span style="color:#66d9ef">end</span>
807
+ <span style="color:#66d9ef">end</span> <span style="color:#66d9ef">if</span> global_opts<span style="color:#f92672">[</span><span style="color:#e6db74">:color</span><span style="color:#f92672">]</span>
796
808
 
797
809
  puts filelist
798
- end
799
- </code></pre>
800
-
801
- <p>You should be able to run it now:</p>
802
-
803
- <pre><code class="language-bash">mytool -c list -asd
804
- </code></pre>
805
-
806
- <p>Note how the parameters come after the <code>list</code> command in the syntax above. As you create more commands, each will have its own unique set of parameters, while the options remain <em>before</em> the command and are available to all of them.</p>
807
-
810
+ <span style="color:#66d9ef">end</span>
811
+ </code></pre></div><p>You should be able to run it now:</p>
812
+ <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">mytool -c list -asd
813
+ </code></pre></div><p>Note how the parameters come after the <code>list</code> command in the syntax above. As you create more commands, each will have its own unique set of parameters, while the options remain <em>before</em> the command and are available to all of them.</p>
808
814
  <h3 id="user-prompting">User Prompting</h3>
809
-
810
815
  <p>There is an additional option when declaring parameters to prompt the user for a value if not entered on the command line. This can be done with the <code>prompt:</code> keyword. Let&rsquo;s change one of our parameters to utilize it:</p>
811
-
812
- <pre><code class="language-ruby">parameter :sort, 'Sort output alphabetically', type: :boolean, default: false, prompt: &quot;Sort output alphabetically?&quot;
813
- </code></pre>
814
-
815
- <p>Now, let&rsquo;s run the tool while omitting the <code>--sort</code> parameter, as such:</p>
816
-
817
- <pre><code class="language-bash">mytool -c list -ad
818
- </code></pre>
819
-
820
- <p>This should give you the prompt:</p>
821
-
816
+ <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-ruby" data-lang="ruby">parameter <span style="color:#e6db74">:sort</span>, <span style="color:#e6db74">&#39;Sort output alphabetically&#39;</span>, <span style="color:#e6db74">type</span>: <span style="color:#e6db74">:boolean</span>, <span style="color:#e6db74">default</span>: <span style="color:#66d9ef">false</span>, <span style="color:#e6db74">prompt</span>: <span style="color:#e6db74">&#34;Sort output alphabetically?&#34;</span>
817
+ </code></pre></div><p>Now, let&rsquo;s run the tool while omitting the <code>--sort</code> parameter, as such:</p>
818
+ <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">mytool -c list -ad
819
+ </code></pre></div><p>This should give you the prompt:</p>
822
820
  <pre><code>Sort output alphabetically? (y/N):
823
- </code></pre>
824
-
825
- <p>Because we set the parameter to default to <code>false</code> the default here is <code>N</code>, which is used if the user hits enter without entering a letter. If the default was set to <code>true</code>, then the <code>Y</code> would be capitalized and be the default.</p>
826
-
821
+ </code></pre><p>Because we set the parameter to default to <code>false</code> the default here is <code>N</code>, which is used if the user hits enter without entering a letter. If the default was set to <code>true</code>, then the <code>Y</code> would be capitalized and be the default.</p>
827
822
  <p>For more information, see the documentation on <a href="/rbcli/advanced/interactive_commands/">Interactive Commands</a>.</p>
828
-
829
823
  <h2 id="arguments">Arguments</h2>
830
-
831
824
  <p>Lastly on the command line, there are arguments. Arguments are simply strings without the <code>-</code> character in front, and automatically get passed into an array in your applicaiton. Let&rsquo;s take a look at how we can use them.</p>
832
-
833
825
  <p>Unlike options and parameters, arguments require no setup. So let&rsquo;s assume that we want any arguments passed to the <code>list</code> command to be filenames that you want to display, and that you can pass multiple ones. Since arguments aren&rsquo;t listed automatically by the help function, this is a good example of what to put in your usage text. Let&rsquo;s take a look at what our class looks like now:</p>
834
-
835
- <pre><code class="language-ruby">class List &lt; Rbcli::Command
836
- description %q{List files in current directory}
837
- usage &lt;&lt;-EOF
838
- To list only specific files, you can enter filenames as arguments
839
-
840
- mytool list filename1 filename2...
841
- EOF
842
- parameter :sort, 'Sort output alphabetically', type: :boolean, default: false
843
- parameter :all, 'Show hidden files', type: :boolean, default: false
844
- parameter :directoriesfirst, 'Show directories on top', type: :boolean, default: false
845
-
846
- action do |params, args, global_opts, config|
847
- filelist = []
848
-
849
- # We include dotfiles if specified
850
- include_dotfiles = (params[:all]) ? File::FNM_DOTMATCH : 0
826
+ <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-ruby" data-lang="ruby"><span style="color:#66d9ef">class</span> <span style="color:#a6e22e">List</span> <span style="color:#f92672">&lt;</span> <span style="color:#66d9ef">Rbcli</span><span style="color:#f92672">::</span><span style="color:#66d9ef">Command</span>
827
+ description <span style="color:#e6db74">%q{List files in current directory}</span>
828
+ usage <span style="color:#e6db74">&lt;&lt;-EOF
829
+ </span><span style="color:#e6db74"></span><span style="color:#66d9ef">To</span> list only specific files, you can enter filenames as arguments
830
+
831
+ mytool list filename1 filename2<span style="color:#f92672">...</span>
832
+ <span style="color:#66d9ef">EOF</span>
833
+ parameter <span style="color:#e6db74">:sort</span>, <span style="color:#e6db74">&#39;Sort output alphabetically&#39;</span>, <span style="color:#e6db74">type</span>: <span style="color:#e6db74">:boolean</span>, <span style="color:#e6db74">default</span>: <span style="color:#66d9ef">false</span>
834
+ parameter <span style="color:#e6db74">:all</span>, <span style="color:#e6db74">&#39;Show hidden files&#39;</span>, <span style="color:#e6db74">type</span>: <span style="color:#e6db74">:boolean</span>, <span style="color:#e6db74">default</span>: <span style="color:#66d9ef">false</span>
835
+ parameter <span style="color:#e6db74">:directoriesfirst</span>, <span style="color:#e6db74">&#39;Show directories on top&#39;</span>, <span style="color:#e6db74">type</span>: <span style="color:#e6db74">:boolean</span>, <span style="color:#e6db74">default</span>: <span style="color:#66d9ef">false</span>
836
+
837
+ action <span style="color:#66d9ef">do</span> <span style="color:#f92672">|</span>params, args, global_opts, config<span style="color:#f92672">|</span>
838
+ filelist <span style="color:#f92672">=</span> <span style="color:#f92672">[]</span>
839
+
840
+ <span style="color:#75715e"># We include dotfiles if specified</span>
841
+ include_dotfiles <span style="color:#f92672">=</span> (params<span style="color:#f92672">[</span><span style="color:#e6db74">:all</span><span style="color:#f92672">]</span>) ? <span style="color:#66d9ef">File</span><span style="color:#f92672">::</span><span style="color:#66d9ef">FNM_DOTMATCH</span> : <span style="color:#ae81ff">0</span>
851
842
 
852
- # We store a list of the files in an array, including dotfiles if specified
853
- Dir.glob &quot;./*&quot;, include_dotfiles do |filename|
854
- outname = filename.split('/')[1]
855
- next unless args.include? outname if args.length &gt; 0
856
- outname += '/' if File.directory? filename
857
- filelist.append outname
858
- end
859
-
860
- # Sort alphabetically if specified
861
- filelist.sort! if params[:sort]
862
-
863
- # Put directories first if specified
864
- if params[:directoriesfirst]
865
- files = []; dirs = []
866
- filelist.each do |filename|
867
- if File.directory? filename
868
- dirs.append(filename)
869
- else
870
- files.append(filename)
871
- end
872
- end
873
- filelist = dirs + files
874
- end
843
+ <span style="color:#75715e"># We store a list of the files in an array, including dotfiles if specified</span>
844
+ <span style="color:#66d9ef">Dir</span><span style="color:#f92672">.</span>glob <span style="color:#e6db74">&#34;./*&#34;</span>, include_dotfiles <span style="color:#66d9ef">do</span> <span style="color:#f92672">|</span>filename<span style="color:#f92672">|</span>
845
+ outname <span style="color:#f92672">=</span> filename<span style="color:#f92672">.</span>split(<span style="color:#e6db74">&#39;/&#39;</span>)<span style="color:#f92672">[</span><span style="color:#ae81ff">1</span><span style="color:#f92672">]</span>
846
+ <span style="color:#66d9ef">next</span> <span style="color:#66d9ef">unless</span> args<span style="color:#f92672">.</span>include? outname <span style="color:#66d9ef">if</span> args<span style="color:#f92672">.</span>length <span style="color:#f92672">&gt;</span> <span style="color:#ae81ff">0</span>
847
+ outname <span style="color:#f92672">+=</span> <span style="color:#e6db74">&#39;/&#39;</span> <span style="color:#66d9ef">if</span> <span style="color:#66d9ef">File</span><span style="color:#f92672">.</span>directory? filename
848
+ filelist<span style="color:#f92672">.</span>append outname
849
+ <span style="color:#66d9ef">end</span>
850
+
851
+ <span style="color:#75715e"># Sort alphabetically if specified</span>
852
+ filelist<span style="color:#f92672">.</span>sort! <span style="color:#66d9ef">if</span> params<span style="color:#f92672">[</span><span style="color:#e6db74">:sort</span><span style="color:#f92672">]</span>
853
+
854
+ <span style="color:#75715e"># Put directories first if specified</span>
855
+ <span style="color:#66d9ef">if</span> params<span style="color:#f92672">[</span><span style="color:#e6db74">:directoriesfirst</span><span style="color:#f92672">]</span>
856
+ files <span style="color:#f92672">=</span> <span style="color:#f92672">[]</span>; dirs <span style="color:#f92672">=</span> <span style="color:#f92672">[]</span>
857
+ filelist<span style="color:#f92672">.</span>each <span style="color:#66d9ef">do</span> <span style="color:#f92672">|</span>filename<span style="color:#f92672">|</span>
858
+ <span style="color:#66d9ef">if</span> <span style="color:#66d9ef">File</span><span style="color:#f92672">.</span>directory? filename
859
+ dirs<span style="color:#f92672">.</span>append(filename)
860
+ <span style="color:#66d9ef">else</span>
861
+ files<span style="color:#f92672">.</span>append(filename)
862
+ <span style="color:#66d9ef">end</span>
863
+ <span style="color:#66d9ef">end</span>
864
+ filelist <span style="color:#f92672">=</span> dirs <span style="color:#f92672">+</span> files
865
+ <span style="color:#66d9ef">end</span>
875
866
 
876
- # Apply color. We do this at the end because color codes can alter the sorting
877
- filelist.map! do |filename|
878
- if File.directory? filename
879
- filename.light_blue
880
- elsif File.executable? filename
881
- filename.light_green
882
- else
867
+ <span style="color:#75715e"># Apply color. We do this at the end because color codes can alter the sorting</span>
868
+ filelist<span style="color:#f92672">.</span>map! <span style="color:#66d9ef">do</span> <span style="color:#f92672">|</span>filename<span style="color:#f92672">|</span>
869
+ <span style="color:#66d9ef">if</span> <span style="color:#66d9ef">File</span><span style="color:#f92672">.</span>directory? filename
870
+ filename<span style="color:#f92672">.</span>light_blue
871
+ <span style="color:#66d9ef">elsif</span> <span style="color:#66d9ef">File</span><span style="color:#f92672">.</span>executable? filename
872
+ filename<span style="color:#f92672">.</span>light_green
873
+ <span style="color:#66d9ef">else</span>
883
874
  filename
884
- end
885
- end if global_opts[:color]
875
+ <span style="color:#66d9ef">end</span>
876
+ <span style="color:#66d9ef">end</span> <span style="color:#66d9ef">if</span> global_opts<span style="color:#f92672">[</span><span style="color:#e6db74">:color</span><span style="color:#f92672">]</span>
886
877
 
887
878
  puts filelist
888
- end
889
- end
890
- </code></pre>
891
-
892
- <h2 id="simplified-reference-tldr">Simplified Reference (TLDR)</h2>
893
-
879
+ <span style="color:#66d9ef">end</span>
880
+ <span style="color:#66d9ef">end</span>
881
+ </code></pre></div><h2 id="simplified-reference-tldr">Simplified Reference (TLDR)</h2>
894
882
  <p>RBCli enforces a CLI structure of:</p>
895
-
896
883
  <pre><code>toolname [options] command [parameters] argument1 argument2...
897
- </code></pre>
898
-
899
- <p><strong>Options</strong> are declared in <code>application/options.rb</code> file.</p>
900
-
884
+ </code></pre><p><strong>Options</strong> are declared in <code>application/options.rb</code> file.</p>
901
885
  <p><strong>Parameters</strong> are declared in the respective command&rsquo;s class declaration.</p>
902
-
903
886
  <p><strong>Arguments</strong> don&rsquo;t need to be declared, and are passed in as an array to your commands. It is helpful to describe the argument purpose in the <code>usage</code> text declaration so that the user can see what to do in the help.</p>
904
-
905
887
  <p><strong>Options</strong> and <strong>parameters</strong> both use the same format:</p>
888
+ <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-ruby" data-lang="ruby">option <span style="color:#e6db74">:&lt;</span>name<span style="color:#f92672">&gt;</span>, <span style="color:#e6db74">&#34;&lt;description_string&gt;&#34;</span>, <span style="color:#e6db74">short</span>: <span style="color:#e6db74">&#39;&lt;character&gt;&#39;</span>, <span style="color:#e6db74">type</span>: <span style="color:#f92672">&lt;</span>variable_type<span style="color:#f92672">&gt;</span>, <span style="color:#e6db74">default</span>: <span style="color:#f92672">&lt;</span>default_value<span style="color:#f92672">&gt;</span>, <span style="color:#e6db74">permitted</span>: <span style="color:#f92672">[&lt;</span>array_of_permitted_values<span style="color:#f92672">]</span>
906
889
 
907
- <pre><code class="language-ruby">option :&lt;name&gt;, &quot;&lt;description_string&gt;&quot;, short: '&lt;character&gt;', type: &lt;variable_type&gt;, default: &lt;default_value&gt;, permitted: [&lt;array_of_permitted_values]
908
-
909
- parameter :&lt;name&gt;, &quot;&lt;description_string&gt;&quot;, short: '&lt;character&gt;', type: &lt;variable_type&gt;, default: &lt;default_value&gt;, permitted: [&lt;array_of_permitted_values]
910
- </code></pre>
911
-
912
- <ul>
890
+ parameter <span style="color:#e6db74">:&lt;</span>name<span style="color:#f92672">&gt;</span>, <span style="color:#e6db74">&#34;&lt;description_string&gt;&#34;</span>, <span style="color:#e6db74">short</span>: <span style="color:#e6db74">&#39;&lt;character&gt;&#39;</span>, <span style="color:#e6db74">type</span>: <span style="color:#f92672">&lt;</span>variable_type<span style="color:#f92672">&gt;</span>, <span style="color:#e6db74">default</span>: <span style="color:#f92672">&lt;</span>default_value<span style="color:#f92672">&gt;</span>, <span style="color:#e6db74">permitted</span>: <span style="color:#f92672">[&lt;</span>array_of_permitted_values<span style="color:#f92672">]</span>
891
+ </code></pre></div><ul>
913
892
  <li><code>name</code>
914
-
915
893
  <ul>
916
894
  <li>(Required) The long name of the option, as a symbol. This will be represented as <code>--name</code> on the command line</li>
917
- </ul></li>
895
+ </ul>
896
+ </li>
918
897
  <li><code>description_string</code>
919
-
920
898
  <ul>
921
899
  <li>(Required) A short description of the command that will appear in the help text for the user</li>
922
- </ul></li>
900
+ </ul>
901
+ </li>
923
902
  <li><code>type</code>
924
-
925
903
  <ul>
926
904
  <li>(Required) The following types are supported: <code>:string</code>, <code>:boolean</code> or <code>:flag</code>, <code>:integer</code>, and <code>:float</code></li>
927
- </ul></li>
905
+ </ul>
906
+ </li>
928
907
  <li><code>default</code>
929
-
930
908
  <ul>
931
909
  <li>(Optional) A default value for the option if one isn&rsquo;t entered (default: nil)</li>
932
- </ul></li>
910
+ </ul>
911
+ </li>
933
912
  <li><code>short</code>
934
-
935
913
  <ul>
936
914
  <li>(Optional) A letter that acts as a shortcut for the option. This will allow users to apply the command as <code>-n</code></li>
937
915
  <li>To not have a short value, set this to :none (default: the first letter of the long name)</li>
938
- </ul></li>
916
+ </ul>
917
+ </li>
939
918
  <li><code>required</code>
940
-
941
919
  <ul>
942
920
  <li>(Optional) Specify whether the option is required from the user (default: false)</li>
943
- </ul></li>
921
+ </ul>
922
+ </li>
944
923
  <li><code>permitted</code>
945
-
946
924
  <ul>
947
925
  <li>(Optional) An array of whitelisted values for the option (default: nil)</li>
948
- </ul></li>
949
926
  </ul>
950
-
927
+ </li>
928
+ </ul>
951
929
  <h2 id="next-steps">Next Steps</h2>
952
-
953
930
  <p>Next, we&rsquo;re going to take a quick look at how to publish and distribute your application, both publicly and within your organization.</p>
954
931
 
955
932
 
956
- <footer class=" footline" >
933
+ <footer class="footline">
957
934
 
958
935
  </footer>
959
936
 
960
-
961
937
 
962
938
  </div>
963
939
 
@@ -1385,20 +1361,19 @@ parameter :&lt;name&gt;, &quot;&lt;description_string&gt;&quot;, short: '&lt;cha
1385
1361
  <div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;">
1386
1362
  <div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div>
1387
1363
  </div>
1388
- <script src="/rbcli/js/clipboard.min.js?1561087612"></script>
1389
- <script src="/rbcli/js/perfect-scrollbar.min.js?1561087612"></script>
1390
- <script src="/rbcli/js/perfect-scrollbar.jquery.min.js?1561087612"></script>
1391
- <script src="/rbcli/js/jquery.sticky.js?1561087612"></script>
1392
- <script src="/rbcli/js/featherlight.min.js?1561087612"></script>
1393
- <script src="/rbcli/js/html5shiv-printshiv.min.js?1561087612"></script>
1394
- <script src="/rbcli/js/highlight.pack.js?1561087612"></script>
1364
+ <script src="/rbcli/js/clipboard.min.js?1596148729"></script>
1365
+ <script src="/rbcli/js/perfect-scrollbar.min.js?1596148729"></script>
1366
+ <script src="/rbcli/js/perfect-scrollbar.jquery.min.js?1596148729"></script>
1367
+ <script src="/rbcli/js/jquery.sticky.js?1596148729"></script>
1368
+ <script src="/rbcli/js/featherlight.min.js?1596148729"></script>
1369
+ <script src="/rbcli/js/highlight.pack.js?1596148729"></script>
1395
1370
  <script>hljs.initHighlightingOnLoad();</script>
1396
- <script src="/rbcli/js/modernizr.custom-3.6.0.js?1561087612"></script>
1397
- <script src="/rbcli/js/learn.js?1561087612"></script>
1398
- <script src="/rbcli/js/hugo-learn.js?1561087612"></script>
1371
+ <script src="/rbcli/js/modernizr.custom-3.6.0.js?1596148729"></script>
1372
+ <script src="/rbcli/js/learn.js?1596148729"></script>
1373
+ <script src="/rbcli/js/hugo-learn.js?1596148729"></script>
1399
1374
 
1400
- <link href="/rbcli/mermaid/mermaid.css?1561087612" rel="stylesheet" />
1401
- <script src="/rbcli/mermaid/mermaid.js?1561087612"></script>
1375
+ <link href="/rbcli/mermaid/mermaid.css?1596148729" rel="stylesheet" />
1376
+ <script src="/rbcli/mermaid/mermaid.js?1596148729"></script>
1402
1377
  <script>
1403
1378
  mermaid.initialize({ startOnLoad: true });
1404
1379
  </script>