rbcli 0.2.12 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
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>Advanced :: 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">
@@ -613,7 +659,7 @@
613
659
 
614
660
  <a href='/rbcli/'></a> > Advanced
615
661
 
616
-
662
+
617
663
 
618
664
 
619
665
 
@@ -636,11 +682,7 @@
636
682
 
637
683
 
638
684
 
639
-
640
-
641
-
642
- <h1 id="advanced-features">Advanced Features</h1>
643
-
685
+ <h1 id="advanced-features">Advanced Features</h1>
644
686
  <p>This section describes the more advanced feature of RBCli. Mastering them will make you a CLI tool Ninja.</p>
645
687
 
646
688
 
@@ -1076,20 +1118,19 @@
1076
1118
  <div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;">
1077
1119
  <div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div>
1078
1120
  </div>
1079
- <script src="/rbcli/js/clipboard.min.js?1561087612"></script>
1080
- <script src="/rbcli/js/perfect-scrollbar.min.js?1561087612"></script>
1081
- <script src="/rbcli/js/perfect-scrollbar.jquery.min.js?1561087612"></script>
1082
- <script src="/rbcli/js/jquery.sticky.js?1561087612"></script>
1083
- <script src="/rbcli/js/featherlight.min.js?1561087612"></script>
1084
- <script src="/rbcli/js/html5shiv-printshiv.min.js?1561087612"></script>
1085
- <script src="/rbcli/js/highlight.pack.js?1561087612"></script>
1121
+ <script src="/rbcli/js/clipboard.min.js?1596148729"></script>
1122
+ <script src="/rbcli/js/perfect-scrollbar.min.js?1596148729"></script>
1123
+ <script src="/rbcli/js/perfect-scrollbar.jquery.min.js?1596148729"></script>
1124
+ <script src="/rbcli/js/jquery.sticky.js?1596148729"></script>
1125
+ <script src="/rbcli/js/featherlight.min.js?1596148729"></script>
1126
+ <script src="/rbcli/js/highlight.pack.js?1596148729"></script>
1086
1127
  <script>hljs.initHighlightingOnLoad();</script>
1087
- <script src="/rbcli/js/modernizr.custom-3.6.0.js?1561087612"></script>
1088
- <script src="/rbcli/js/learn.js?1561087612"></script>
1089
- <script src="/rbcli/js/hugo-learn.js?1561087612"></script>
1128
+ <script src="/rbcli/js/modernizr.custom-3.6.0.js?1596148729"></script>
1129
+ <script src="/rbcli/js/learn.js?1596148729"></script>
1130
+ <script src="/rbcli/js/hugo-learn.js?1596148729"></script>
1090
1131
 
1091
- <link href="/rbcli/mermaid/mermaid.css?1561087612" rel="stylesheet" />
1092
- <script src="/rbcli/mermaid/mermaid.js?1561087612"></script>
1132
+ <link href="/rbcli/mermaid/mermaid.css?1596148729" rel="stylesheet" />
1133
+ <script src="/rbcli/mermaid/mermaid.js?1596148729"></script>
1093
1134
  <script>
1094
1135
  mermaid.initialize({ startOnLoad: true });
1095
1136
  </script>
@@ -1,4 +1,4 @@
1
- <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
1
+ <?xml version="1.0" encoding="utf-8" standalone="yes"?>
2
2
  <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
3
3
  <channel>
4
4
  <title>Advanced on RBCli Documentation</title>
@@ -31,7 +31,7 @@ GitHub Update Check The GitHub update check works best when paired with GitHub&a
31
31
  <description>RBCli has three different command types:
32
32
  Standard Commands (Ruby-based) Scripted Commands (Ruby+Bash based) External Commands (Wrapping a 3rd party application) This document is provided to be a reference. If you would like an in-depth tutorial, please see Your First Command.
33
33
  General Command Structure Commands in RBCli are created by subclassing Rbcli::Command. All commands share a certain common structure:
34
- class List &amp;lt; Rbcli::Command # Declare a new command by subclassing Rbcli::Command description &#39;TODO: Description goes here&#39; # (Required) Short description for the global help usage &amp;lt;&amp;lt;-EOF TODO: Usage text goes here EOF # (Required) Long description for the command-specific help parameter :force, &#39;Force testing&#39;, type: :boolean, default: false, required: false # (Optional, Multiple) Add a command-specific CLI parameter.</description>
34
+ class List &amp;lt; Rbcli::Command # Declare a new command by subclassing Rbcli::Command description &amp;#39;TODO: Description goes here&amp;#39; # (Required) Short description for the global help usage &amp;lt;&amp;lt;-EOF TODO: Usage text goes here EOF # (Required) Long description for the command-specific help parameter :force, &amp;#39;Force testing&amp;#39;, type: :boolean, default: false, required: false # (Optional, Multiple) Add a command-specific CLI parameter.</description>
35
35
  </item>
36
36
 
37
37
  <item>
@@ -73,8 +73,8 @@ Of course, we want to make sure that scripting with the tool still works well (h
73
73
 
74
74
  <guid>https://akhoury6.github.io/rbcli/advanced/logging/</guid>
75
75
  <description>Logging with RBCli is straightforward - it looks at the config file for logging settings, and instantiates a single, globally accessible Logger object. You can access it within a standard command like this:
76
- Rbcli::log.info { &#39;These logs can go to STDERR, STDOUT, or a file&#39; } Enabling Logging To enable logging, simply set the default values in the config/logging.rb file:
77
- log_level :info log_target &#39;stderr&#39; log_level You can set the default log level using either numeric or standard Ruby logger levels: 0-5, or DEBUG &amp;lt; INFO &amp;lt; WARN &amp;lt; ERROR &amp;lt; FATAL &amp;lt; UNKNOWN log_target This specifies where the logs will be placed.</description>
76
+ Rbcli::log.info { &amp;#39;These logs can go to STDERR, STDOUT, or a file&amp;#39; } Enabling Logging To enable logging, simply set the default values in the config/logging.rb file:
77
+ log_level :info log_target &amp;#39;stderr&amp;#39; log_level You can set the default log level using either numeric or standard Ruby logger levels: 0-5, or DEBUG &amp;lt; INFO &amp;lt; WARN &amp;lt; ERROR &amp;lt; FATAL &amp;lt; UNKNOWN log_target This specifies where the logs will be placed.</description>
78
78
  </item>
79
79
 
80
80
  <item>
@@ -86,8 +86,8 @@ log_level :info log_target &#39;stderr&#39; log_level You can set the default
86
86
  <description>RBCli can be configured to execute commands on a remote machine via SSH instead of locally.
87
87
  Currently, only script and extern commands are supported.
88
88
  Configuration To allow remote execution, go to config/general.rb and change the following line to true:
89
- remote_execution permitted: false Then, for each command that you would like to enable remote execution for, add the following directive to the command class declaration:
90
- remote_permitted Usage Your end users can now execute a command remotely by specifying the connection string and credentials on the command line as follows:</description>
89
+ remote_execution permitted: false Then, for each command that you would like to enable remote execution for, add the following directive to the command class declaration:
90
+ remote_permitted Usage Your end users can now execute a command remotely by specifying the connection string and credentials on the command line as follows:</description>
91
91
  </item>
92
92
 
93
93
  <item>
@@ -99,8 +99,8 @@ remote_permitted Usage Your end users can now execute a command remotely by spe
99
99
  <description>RBCli supports both local and remote state storage. This is done by synchronizing a Hash with either the local disk or a remote database.
100
100
  Local State RBCli&amp;rsquo;s local state storage gives you access to a hash that is automatically persisted to disk when changes are made.
101
101
  Configuration You can configure it in config/storage.rb.
102
- local_state &#39;/var/mytool/localstate&#39;, force_creation: true, halt_on_error: true There are three parameters to configure it with:
103
- The path as a string (self-explanatory) force_creation This will attempt to create the path and file if it does not exist (equivalent to an mkdir -p and touch in linux) halt_on_error RBCli&amp;rsquo;s default behavior is to raise an exception if the file can not be created, read, or updated at any point in time If this is set to false, RBCli will silence any errors pertaining to file access and will fall back to whatever data is available.</description>
102
+ local_state &amp;#39;/var/mytool/localstate&amp;#39;, force_creation: true, halt_on_error: true There are three parameters to configure it with:
103
+ The path as a string (self-explanatory) force_creation This will attempt to create the path and file if it does not exist (equivalent to an mkdir -p and touch in linux) halt_on_error RBCli&amp;rsquo;s default behavior is to raise an exception if the file can not be created, read, or updated at any point in time If this is set to false, RBCli will silence any errors pertaining to file access and will fall back to whatever data is available.</description>
104
104
  </item>
105
105
 
106
106
  <item>
@@ -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>Interactive Commands :: 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/advanced/'>Advanced</a> > Interactive Commands
621
667
 
622
-
668
+
623
669
 
624
-
670
+
625
671
 
626
672
 
627
673
 
@@ -631,13 +677,10 @@
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="#why-interactive-commands">Why interactive commands?</a></li>
638
- <li><a href="#how-to-do-it-with-rbcli">How to do it with Rbcli</a></li>
639
- </ul></li>
640
- </ul>
680
+ <ul>
681
+ <li><a href="#why-interactive-commands">Why interactive commands?</a></li>
682
+ <li><a href="#how-to-do-it-with-rbcli">How to do it with Rbcli</a></li>
683
+ </ul>
641
684
  </nav>
642
685
  </div>
643
686
  </div>
@@ -661,47 +704,29 @@
661
704
 
662
705
 
663
706
 
664
-
665
-
666
-
667
707
  <h2 id="why-interactive-commands">Why interactive commands?</h2>
668
-
669
708
  <p>When catering to an audience of users who are not accustomed to scripting, you may want to prompt them for the information directly (the typical CS-101 &lsquo;puts&rsquo; and &lsquo;gets&rsquo; pattern). This can be a lot more straightforward than having to read the help texts of your tool, and trying multiple times to enter all of the required data.</p>
670
-
671
709
  <p>Of course, we want to make sure that scripting with the tool still works well (headless interaction). We accomplish this by extending our parameters with a <code>prompt</code> option; RBCli will continue to accept the parameter as usual, but if the parameter is omitted then it will prompt the user with the given text.</p>
672
-
673
710
  <h2 id="how-to-do-it-with-rbcli">How to do it with Rbcli</h2>
674
-
675
711
  <p>There is an option when declaring a command&rsquo;s 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. For example:</p>
676
-
677
- <pre><code class="language-ruby">class Mycmd &lt; Rbcli::Command
678
- parameter :sort, 'Sort output alphabetically', type: :boolean, default: false, prompt: &quot;Sort output alphabetically?&quot;
679
- action do |params, args, global_opts, config|
680
- puts params[:sort]
681
- end
682
- end
683
- </code></pre>
684
-
685
- <p>Now, if we run the command while omitting the <code>--sort</code> parameter, as such:</p>
686
-
687
- <pre><code class="language-bash">mytool mycmd
688
- </code></pre>
689
-
690
- <p>That should give you the prompt:</p>
691
-
712
+ <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">Mycmd</span> <span style="color:#f92672">&lt;</span> <span style="color:#66d9ef">Rbcli</span><span style="color:#f92672">::</span><span style="color:#66d9ef">Command</span>
713
+ 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>
714
+ action <span style="color:#66d9ef">do</span> <span style="color:#f92672">|</span>params, args, global_opts, config<span style="color:#f92672">|</span>
715
+ puts params<span style="color:#f92672">[</span><span style="color:#e6db74">:sort</span><span style="color:#f92672">]</span>
716
+ <span style="color:#66d9ef">end</span>
717
+ <span style="color:#66d9ef">end</span>
718
+ </code></pre></div><p>Now, if we run the command while omitting the <code>--sort</code> parameter, as such:</p>
719
+ <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 mycmd
720
+ </code></pre></div><p>That should give you the prompt:</p>
692
721
  <pre><code>Sort output alphabetically? (y/N):
693
- </code></pre>
694
-
695
- <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>
696
-
722
+ </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>
697
723
  <p>String parameters behave similarly, but default to the string defined instead of a boolean value.</p>
698
724
 
699
725
 
700
- <footer class=" footline" >
726
+ <footer class="footline">
701
727
 
702
728
  </footer>
703
729
 
704
-
705
730
 
706
731
  </div>
707
732
 
@@ -1129,20 +1154,19 @@ end
1129
1154
  <div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;">
1130
1155
  <div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div>
1131
1156
  </div>
1132
- <script src="/rbcli/js/clipboard.min.js?1561087612"></script>
1133
- <script src="/rbcli/js/perfect-scrollbar.min.js?1561087612"></script>
1134
- <script src="/rbcli/js/perfect-scrollbar.jquery.min.js?1561087612"></script>
1135
- <script src="/rbcli/js/jquery.sticky.js?1561087612"></script>
1136
- <script src="/rbcli/js/featherlight.min.js?1561087612"></script>
1137
- <script src="/rbcli/js/html5shiv-printshiv.min.js?1561087612"></script>
1138
- <script src="/rbcli/js/highlight.pack.js?1561087612"></script>
1157
+ <script src="/rbcli/js/clipboard.min.js?1596148729"></script>
1158
+ <script src="/rbcli/js/perfect-scrollbar.min.js?1596148729"></script>
1159
+ <script src="/rbcli/js/perfect-scrollbar.jquery.min.js?1596148729"></script>
1160
+ <script src="/rbcli/js/jquery.sticky.js?1596148729"></script>
1161
+ <script src="/rbcli/js/featherlight.min.js?1596148729"></script>
1162
+ <script src="/rbcli/js/highlight.pack.js?1596148729"></script>
1139
1163
  <script>hljs.initHighlightingOnLoad();</script>
1140
- <script src="/rbcli/js/modernizr.custom-3.6.0.js?1561087612"></script>
1141
- <script src="/rbcli/js/learn.js?1561087612"></script>
1142
- <script src="/rbcli/js/hugo-learn.js?1561087612"></script>
1164
+ <script src="/rbcli/js/modernizr.custom-3.6.0.js?1596148729"></script>
1165
+ <script src="/rbcli/js/learn.js?1596148729"></script>
1166
+ <script src="/rbcli/js/hugo-learn.js?1596148729"></script>
1143
1167
 
1144
- <link href="/rbcli/mermaid/mermaid.css?1561087612" rel="stylesheet" />
1145
- <script src="/rbcli/mermaid/mermaid.js?1561087612"></script>
1168
+ <link href="/rbcli/mermaid/mermaid.css?1596148729" rel="stylesheet" />
1169
+ <script src="/rbcli/mermaid/mermaid.js?1596148729"></script>
1146
1170
  <script>
1147
1171
  mermaid.initialize({ startOnLoad: true });
1148
1172
  </script>