rbcli 0.2.2 → 0.2.4

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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/Gemfile.lock +2 -2
  4. data/README.md +6 -1
  5. data/docs-src/docs/advanced/interactive_commands.md +37 -0
  6. data/docs-src/docs/imported/changelog.md +14 -0
  7. data/docs-src/docs/tutorial/40-options_parameters_and_arguments.md +25 -0
  8. data/docs-src/makesite.sh +1 -1
  9. data/docs-src/mkdocs.yml +3 -1
  10. data/docs/404.html +36 -12
  11. data/docs/advanced/automatic_updates/index.html +36 -12
  12. data/docs/advanced/command_types/index.html +34 -10
  13. data/docs/advanced/distributed_state_locking/index.html +34 -10
  14. data/docs/advanced/hooks/index.html +36 -12
  15. data/docs/advanced/interactive_commands/index.html +829 -0
  16. data/docs/advanced/logging/index.html +833 -0
  17. data/docs/advanced/remote_execution/index.html +36 -12
  18. data/docs/advanced/state_storage/index.html +34 -10
  19. data/docs/advanced/user_config_files/index.html +34 -10
  20. data/docs/assets/javascripts/application.583bbe55.js +1 -0
  21. data/docs/assets/stylesheets/application-palette.22915126.css +1176 -0
  22. data/docs/assets/stylesheets/application.451f80e5.css +2552 -0
  23. data/docs/development/code_of_conduct/index.html +34 -10
  24. data/docs/development/contributing/index.html +36 -12
  25. data/docs/development/license/index.html +34 -10
  26. data/docs/imported/changelog/index.html +132 -27
  27. data/docs/imported/quick_reference/index.html +34 -10
  28. data/docs/index.html +36 -12
  29. data/docs/search/search_index.json +1 -639
  30. data/docs/sitemap.xml +48 -38
  31. data/docs/sitemap.xml.gz +0 -0
  32. data/docs/tutorial/10-getting_started/index.html +34 -10
  33. data/docs/tutorial/20-project_layout/index.html +34 -10
  34. data/docs/tutorial/30-your_first_command/index.html +34 -10
  35. data/docs/tutorial/40-options_parameters_and_arguments/index.html +75 -10
  36. data/docs/tutorial/50-publishing/index.html +34 -10
  37. data/docs/whoami/index.html +36 -12
  38. data/exe/rbcli +1 -1
  39. data/lib/rbcli/engine/command.rb +28 -2
  40. data/lib/rbcli/version.rb +1 -1
  41. data/rbcli.gemspec +1 -1
  42. data/skeletons/project/application/commands/command.erb +1 -1
  43. metadata +10 -6
  44. data/docs/assets/javascripts/application.a59e2a89.js +0 -1
  45. data/docs/assets/stylesheets/application-palette.6079476c.css +0 -2
  46. data/docs/assets/stylesheets/application.ba0fd1a6.css +0 -2
@@ -36,7 +36,7 @@
36
36
  <meta name="lang:search.tokenizer" content="[\s\-]+">
37
37
 
38
38
  <link rel="shortcut icon" href="../../assets/images/favicon.png">
39
- <meta name="generator" content="mkdocs-0.17.5, mkdocs-material-2.9.2">
39
+ <meta name="generator" content="mkdocs-1.0.3, mkdocs-material-3.0.4">
40
40
 
41
41
 
42
42
 
@@ -44,7 +44,7 @@
44
44
 
45
45
 
46
46
 
47
- <link rel="stylesheet" href="../../assets/stylesheets/application.ba0fd1a6.css">
47
+ <link rel="stylesheet" href="../../assets/stylesheets/application.451f80e5.css">
48
48
 
49
49
 
50
50
 
@@ -52,8 +52,8 @@
52
52
  <script src="../../assets/javascripts/modernizr.1aa3b519.js"></script>
53
53
 
54
54
 
55
- <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
56
55
 
56
+ <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
57
57
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
58
58
  <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
59
59
 
@@ -94,7 +94,7 @@
94
94
  <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
95
95
  <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
96
96
 
97
- <a href="#distributed-locking-and-state-sharing" tabindex="1" class="md-skip">
97
+ <a href="../../#distributed-locking-and-state-sharing" tabindex="1" class="md-skip">
98
98
  Skip to content
99
99
  </a>
100
100
 
@@ -264,11 +264,11 @@
264
264
  <div class="md-sidebar__inner">
265
265
  <nav class="md-nav md-nav--primary" data-md-level="0">
266
266
  <label class="md-nav__title md-nav__title--site" for="__drawer">
267
- <span class="md-nav__button md-logo">
267
+ <a href="../.." title="RBCli Documentation" class="md-nav__button md-logo">
268
268
 
269
269
  <i class="md-icon">devices</i>
270
270
 
271
- </span>
271
+ </a>
272
272
  RBCli Documentation
273
273
  </label>
274
274
 
@@ -466,6 +466,18 @@
466
466
 
467
467
 
468
468
 
469
+ <li class="md-nav__item">
470
+ <a href="../logging/" title="Logging" class="md-nav__link">
471
+ Logging
472
+ </a>
473
+ </li>
474
+
475
+
476
+
477
+
478
+
479
+
480
+
469
481
  <li class="md-nav__item">
470
482
  <a href="../automatic_updates/" title="Automatic Updates" class="md-nav__link">
471
483
  Automatic Updates
@@ -547,6 +559,18 @@
547
559
  </li>
548
560
 
549
561
 
562
+
563
+
564
+
565
+
566
+
567
+ <li class="md-nav__item">
568
+ <a href="../interactive_commands/" title="Interactive Commands" class="md-nav__link">
569
+ Interactive Commands
570
+ </a>
571
+ </li>
572
+
573
+
550
574
  </ul>
551
575
  </nav>
552
576
  </li>
@@ -630,8 +654,8 @@
630
654
 
631
655
 
632
656
  <li class="md-nav__item">
633
- <a href="../../whoami/" title="$ whoami" class="md-nav__link">
634
- $ whoami
657
+ <a href="../../whoami/" title="whoami" class="md-nav__link">
658
+ whoami
635
659
  </a>
636
660
  </li>
637
661
 
@@ -777,9 +801,9 @@
777
801
 
778
802
  </div>
779
803
 
780
- <script src="../../assets/javascripts/application.a59e2a89.js"></script>
804
+ <script src="../../assets/javascripts/application.583bbe55.js"></script>
781
805
 
782
- <script>app.initialize({version:"0.17.5",url:{base:"../.."}})</script>
806
+ <script>app.initialize({version:"1.0.3",url:{base:"../.."}})</script>
783
807
 
784
808
 
785
809
 
@@ -36,7 +36,7 @@
36
36
  <meta name="lang:search.tokenizer" content="[\s\-]+">
37
37
 
38
38
  <link rel="shortcut icon" href="../../assets/images/favicon.png">
39
- <meta name="generator" content="mkdocs-0.17.5, mkdocs-material-2.9.2">
39
+ <meta name="generator" content="mkdocs-1.0.3, mkdocs-material-3.0.4">
40
40
 
41
41
 
42
42
 
@@ -44,7 +44,7 @@
44
44
 
45
45
 
46
46
 
47
- <link rel="stylesheet" href="../../assets/stylesheets/application.ba0fd1a6.css">
47
+ <link rel="stylesheet" href="../../assets/stylesheets/application.451f80e5.css">
48
48
 
49
49
 
50
50
 
@@ -52,8 +52,8 @@
52
52
  <script src="../../assets/javascripts/modernizr.1aa3b519.js"></script>
53
53
 
54
54
 
55
- <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
56
55
 
56
+ <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
57
57
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
58
58
  <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
59
59
 
@@ -94,7 +94,7 @@
94
94
  <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
95
95
  <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
96
96
 
97
- <a href="#execution-hooks" tabindex="1" class="md-skip">
97
+ <a href="../../#execution-hooks" tabindex="1" class="md-skip">
98
98
  Skip to content
99
99
  </a>
100
100
 
@@ -264,11 +264,11 @@
264
264
  <div class="md-sidebar__inner">
265
265
  <nav class="md-nav md-nav--primary" data-md-level="0">
266
266
  <label class="md-nav__title md-nav__title--site" for="__drawer">
267
- <span class="md-nav__button md-logo">
267
+ <a href="../.." title="RBCli Documentation" class="md-nav__button md-logo">
268
268
 
269
269
  <i class="md-icon">devices</i>
270
270
 
271
- </span>
271
+ </a>
272
272
  RBCli Documentation
273
273
  </label>
274
274
 
@@ -525,6 +525,18 @@
525
525
 
526
526
 
527
527
 
528
+ <li class="md-nav__item">
529
+ <a href="../logging/" title="Logging" class="md-nav__link">
530
+ Logging
531
+ </a>
532
+ </li>
533
+
534
+
535
+
536
+
537
+
538
+
539
+
528
540
  <li class="md-nav__item">
529
541
  <a href="../automatic_updates/" title="Automatic Updates" class="md-nav__link">
530
542
  Automatic Updates
@@ -568,6 +580,18 @@
568
580
  </li>
569
581
 
570
582
 
583
+
584
+
585
+
586
+
587
+
588
+ <li class="md-nav__item">
589
+ <a href="../interactive_commands/" title="Interactive Commands" class="md-nav__link">
590
+ Interactive Commands
591
+ </a>
592
+ </li>
593
+
594
+
571
595
  </ul>
572
596
  </nav>
573
597
  </li>
@@ -651,8 +675,8 @@
651
675
 
652
676
 
653
677
  <li class="md-nav__item">
654
- <a href="../../whoami/" title="$ whoami" class="md-nav__link">
655
- $ whoami
678
+ <a href="../../whoami/" title="whoami" class="md-nav__link">
679
+ whoami
656
680
  </a>
657
681
  </li>
658
682
 
@@ -796,13 +820,13 @@ rbcli hook -f
796
820
  </a>
797
821
 
798
822
 
799
- <a href="../automatic_updates/" title="Automatic Updates" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
823
+ <a href="../logging/" title="Logging" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
800
824
  <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
801
825
  <span class="md-flex__ellipsis">
802
826
  <span class="md-footer-nav__direction">
803
827
  Next
804
828
  </span>
805
- Automatic Updates
829
+ Logging
806
830
  </span>
807
831
  </div>
808
832
  <div class="md-flex__cell md-flex__cell--shrink">
@@ -836,9 +860,9 @@ rbcli hook -f
836
860
 
837
861
  </div>
838
862
 
839
- <script src="../../assets/javascripts/application.a59e2a89.js"></script>
863
+ <script src="../../assets/javascripts/application.583bbe55.js"></script>
840
864
 
841
- <script>app.initialize({version:"0.17.5",url:{base:"../.."}})</script>
865
+ <script>app.initialize({version:"1.0.3",url:{base:"../.."}})</script>
842
866
 
843
867
 
844
868
 
@@ -0,0 +1,829 @@
1
+
2
+
3
+
4
+
5
+ <!DOCTYPE html>
6
+ <html lang="en" class="no-js">
7
+ <head>
8
+
9
+ <meta charset="utf-8">
10
+ <meta name="viewport" content="width=device-width,initial-scale=1">
11
+ <meta http-equiv="x-ua-compatible" content="ie=edge">
12
+
13
+ <meta name="description" content="Description">
14
+
15
+
16
+
17
+ <meta name="author" content="Andrew Khoury">
18
+
19
+
20
+ <meta name="lang:clipboard.copy" content="Copy to clipboard">
21
+
22
+ <meta name="lang:clipboard.copied" content="Copied to clipboard">
23
+
24
+ <meta name="lang:search.language" content="en">
25
+
26
+ <meta name="lang:search.pipeline.stopwords" content="True">
27
+
28
+ <meta name="lang:search.pipeline.trimmer" content="True">
29
+
30
+ <meta name="lang:search.result.none" content="No matching documents">
31
+
32
+ <meta name="lang:search.result.one" content="1 matching document">
33
+
34
+ <meta name="lang:search.result.other" content="# matching documents">
35
+
36
+ <meta name="lang:search.tokenizer" content="[\s\-]+">
37
+
38
+ <link rel="shortcut icon" href="../../assets/images/favicon.png">
39
+ <meta name="generator" content="mkdocs-1.0.3, mkdocs-material-3.0.4">
40
+
41
+
42
+
43
+ <title>Interactive Commands - RBCli Documentation</title>
44
+
45
+
46
+
47
+ <link rel="stylesheet" href="../../assets/stylesheets/application.451f80e5.css">
48
+
49
+
50
+
51
+
52
+ <script src="../../assets/javascripts/modernizr.1aa3b519.js"></script>
53
+
54
+
55
+
56
+ <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
57
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono">
58
+ <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
59
+
60
+
61
+ <link rel="stylesheet" href="../../assets/fonts/material-icons.css">
62
+
63
+
64
+ </head>
65
+
66
+ <body dir="ltr">
67
+
68
+ <svg class="md-svg">
69
+ <defs>
70
+
71
+
72
+ <svg xmlns="http://www.w3.org/2000/svg" width="416" height="448"
73
+ viewBox="0 0 416 448" id="__github">
74
+ <path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19-18.125
75
+ 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19 18.125-8.5
76
+ 18.125 8.5 10.75 19 3.125 20.5zM320 304q0 10-3.125 20.5t-10.75
77
+ 19-18.125 8.5-18.125-8.5-10.75-19-3.125-20.5 3.125-20.5 10.75-19
78
+ 18.125-8.5 18.125 8.5 10.75 19 3.125 20.5zM360
79
+ 304q0-30-17.25-51t-46.75-21q-10.25 0-48.75 5.25-17.75 2.75-39.25
80
+ 2.75t-39.25-2.75q-38-5.25-48.75-5.25-29.5 0-46.75 21t-17.25 51q0 22 8
81
+ 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0
82
+ 37.25-1.75t35-7.375 30.5-15 20.25-25.75 8-38.375zM416 260q0 51.75-15.25
83
+ 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5-41.75
84
+ 1.125q-19.5 0-35.5-0.75t-36.875-3.125-38.125-7.5-34.25-12.875-30.25-20.25-21.5-28.75q-15.5-30.75-15.5-82.75
85
+ 0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25
86
+ 30.875q36.75-8.75 77.25-8.75 37 0 70 8 26.25-20.5
87
+ 46.75-30.25t47.25-9.75q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34
88
+ 99.5z" />
89
+ </svg>
90
+
91
+ </defs>
92
+ </svg>
93
+ <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
94
+ <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
95
+ <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
96
+
97
+ <a href="../../#interactive-commands" tabindex="1" class="md-skip">
98
+ Skip to content
99
+ </a>
100
+
101
+
102
+ <header class="md-header" data-md-component="header">
103
+ <nav class="md-header-nav md-grid">
104
+ <div class="md-flex">
105
+ <div class="md-flex__cell md-flex__cell--shrink">
106
+ <a href="../.." title="RBCli Documentation" class="md-header-nav__button md-logo">
107
+
108
+ <i class="md-icon">devices</i>
109
+
110
+ </a>
111
+ </div>
112
+ <div class="md-flex__cell md-flex__cell--shrink">
113
+ <label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
114
+ </div>
115
+ <div class="md-flex__cell md-flex__cell--stretch">
116
+ <div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
117
+
118
+
119
+ <span class="md-header-nav__topic">
120
+ RBCli Documentation
121
+ </span>
122
+ <span class="md-header-nav__topic">
123
+ Interactive Commands
124
+ </span>
125
+
126
+
127
+ </div>
128
+ </div>
129
+ <div class="md-flex__cell md-flex__cell--shrink">
130
+
131
+
132
+ <label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
133
+
134
+ <div class="md-search" data-md-component="search" role="dialog">
135
+ <label class="md-search__overlay" for="__search"></label>
136
+ <div class="md-search__inner" role="search">
137
+ <form class="md-search__form" name="search">
138
+ <input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
139
+ <label class="md-icon md-search__icon" for="__search"></label>
140
+ <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
141
+ &#xE5CD;
142
+ </button>
143
+ </form>
144
+ <div class="md-search__output">
145
+ <div class="md-search__scrollwrap" data-md-scrollfix>
146
+ <div class="md-search-result" data-md-component="result">
147
+ <div class="md-search-result__meta">
148
+ Type to start searching
149
+ </div>
150
+ <ol class="md-search-result__list"></ol>
151
+ </div>
152
+ </div>
153
+ </div>
154
+ </div>
155
+ </div>
156
+
157
+
158
+ </div>
159
+
160
+ <div class="md-flex__cell md-flex__cell--shrink">
161
+ <div class="md-header-nav__source">
162
+
163
+
164
+
165
+
166
+
167
+
168
+ <a href="https://github.com/akhoury6/rbcli/" title="Go to repository" class="md-source" data-md-source="github">
169
+
170
+ <div class="md-source__icon">
171
+ <svg viewBox="0 0 24 24" width="24" height="24">
172
+ <use xlink:href="#__github" width="24" height="24"></use>
173
+ </svg>
174
+ </div>
175
+
176
+ <div class="md-source__repository">
177
+ GitHub
178
+ </div>
179
+ </a>
180
+
181
+ </div>
182
+ </div>
183
+
184
+ </div>
185
+ </nav>
186
+ </header>
187
+
188
+ <div class="md-container">
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+ <nav class="md-tabs md-tabs--active" data-md-component="tabs">
198
+ <div class="md-tabs__inner md-grid">
199
+ <ul class="md-tabs__list">
200
+
201
+
202
+ <li class="md-tabs__item">
203
+
204
+ <a href="../.." title="Home" class="md-tabs__link">
205
+ Home
206
+ </a>
207
+
208
+ </li>
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+ <li class="md-tabs__item">
217
+
218
+ <a href="../../tutorial/10-getting_started/" title="Tutorial" class="md-tabs__link">
219
+ Tutorial
220
+ </a>
221
+
222
+ </li>
223
+
224
+
225
+
226
+
227
+
228
+
229
+ <li class="md-tabs__item">
230
+
231
+ <a href="../command_types/" title="Advanced Features" class="md-tabs__link md-tabs__link--active">
232
+ Advanced Features
233
+ </a>
234
+
235
+ </li>
236
+
237
+
238
+
239
+
240
+
241
+
242
+ <li class="md-tabs__item">
243
+
244
+ <a href="../../development/contributing/" title="Development" class="md-tabs__link">
245
+ Development
246
+ </a>
247
+
248
+ </li>
249
+
250
+
251
+
252
+
253
+
254
+ </ul>
255
+ </div>
256
+ </nav>
257
+
258
+ <main class="md-main">
259
+ <div class="md-main__inner md-grid" data-md-component="container">
260
+
261
+
262
+ <div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
263
+ <div class="md-sidebar__scrollwrap">
264
+ <div class="md-sidebar__inner">
265
+ <nav class="md-nav md-nav--primary" data-md-level="0">
266
+ <label class="md-nav__title md-nav__title--site" for="__drawer">
267
+ <a href="../.." title="RBCli Documentation" class="md-nav__button md-logo">
268
+
269
+ <i class="md-icon">devices</i>
270
+
271
+ </a>
272
+ RBCli Documentation
273
+ </label>
274
+
275
+ <div class="md-nav__source">
276
+
277
+
278
+
279
+
280
+
281
+
282
+ <a href="https://github.com/akhoury6/rbcli/" title="Go to repository" class="md-source" data-md-source="github">
283
+
284
+ <div class="md-source__icon">
285
+ <svg viewBox="0 0 24 24" width="24" height="24">
286
+ <use xlink:href="#__github" width="24" height="24"></use>
287
+ </svg>
288
+ </div>
289
+
290
+ <div class="md-source__repository">
291
+ GitHub
292
+ </div>
293
+ </a>
294
+
295
+ </div>
296
+
297
+ <ul class="md-nav__list" data-md-scrollfix>
298
+
299
+
300
+
301
+
302
+
303
+
304
+ <li class="md-nav__item">
305
+ <a href="../.." title="Home" class="md-nav__link">
306
+ Home
307
+ </a>
308
+ </li>
309
+
310
+
311
+
312
+
313
+
314
+
315
+
316
+ <li class="md-nav__item">
317
+ <a href="../../imported/quick_reference/" title="Quick Reference" class="md-nav__link">
318
+ Quick Reference
319
+ </a>
320
+ </li>
321
+
322
+
323
+
324
+
325
+
326
+
327
+
328
+ <li class="md-nav__item md-nav__item--nested">
329
+
330
+ <input class="md-toggle md-nav__toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3">
331
+
332
+ <label class="md-nav__link" for="nav-3">
333
+ Tutorial
334
+ </label>
335
+ <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
336
+ <label class="md-nav__title" for="nav-3">
337
+ Tutorial
338
+ </label>
339
+ <ul class="md-nav__list" data-md-scrollfix>
340
+
341
+
342
+
343
+
344
+
345
+
346
+
347
+ <li class="md-nav__item">
348
+ <a href="../../tutorial/10-getting_started/" title="Getting Started" class="md-nav__link">
349
+ Getting Started
350
+ </a>
351
+ </li>
352
+
353
+
354
+
355
+
356
+
357
+
358
+
359
+ <li class="md-nav__item">
360
+ <a href="../../tutorial/20-project_layout/" title="The Project Layout" class="md-nav__link">
361
+ The Project Layout
362
+ </a>
363
+ </li>
364
+
365
+
366
+
367
+
368
+
369
+
370
+
371
+ <li class="md-nav__item">
372
+ <a href="../../tutorial/30-your_first_command/" title="Your First Command" class="md-nav__link">
373
+ Your First Command
374
+ </a>
375
+ </li>
376
+
377
+
378
+
379
+
380
+
381
+
382
+
383
+ <li class="md-nav__item">
384
+ <a href="../../tutorial/40-options_parameters_and_arguments/" title="Options, Parameters, and Arguments" class="md-nav__link">
385
+ Options, Parameters, and Arguments
386
+ </a>
387
+ </li>
388
+
389
+
390
+
391
+
392
+
393
+
394
+
395
+ <li class="md-nav__item">
396
+ <a href="../../tutorial/50-publishing/" title="Publishing and Distribution" class="md-nav__link">
397
+ Publishing and Distribution
398
+ </a>
399
+ </li>
400
+
401
+
402
+ </ul>
403
+ </nav>
404
+ </li>
405
+
406
+
407
+
408
+
409
+
410
+
411
+
412
+
413
+
414
+ <li class="md-nav__item md-nav__item--active md-nav__item--nested">
415
+
416
+ <input class="md-toggle md-nav__toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4" checked>
417
+
418
+ <label class="md-nav__link" for="nav-4">
419
+ Advanced Features
420
+ </label>
421
+ <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
422
+ <label class="md-nav__title" for="nav-4">
423
+ Advanced Features
424
+ </label>
425
+ <ul class="md-nav__list" data-md-scrollfix>
426
+
427
+
428
+
429
+
430
+
431
+
432
+
433
+ <li class="md-nav__item">
434
+ <a href="../command_types/" title="Command Types" class="md-nav__link">
435
+ Command Types
436
+ </a>
437
+ </li>
438
+
439
+
440
+
441
+
442
+
443
+
444
+
445
+ <li class="md-nav__item">
446
+ <a href="../user_config_files/" title="User Config Files" class="md-nav__link">
447
+ User Config Files
448
+ </a>
449
+ </li>
450
+
451
+
452
+
453
+
454
+
455
+
456
+
457
+ <li class="md-nav__item">
458
+ <a href="../hooks/" title="Hooks" class="md-nav__link">
459
+ Hooks
460
+ </a>
461
+ </li>
462
+
463
+
464
+
465
+
466
+
467
+
468
+
469
+ <li class="md-nav__item">
470
+ <a href="../logging/" title="Logging" class="md-nav__link">
471
+ Logging
472
+ </a>
473
+ </li>
474
+
475
+
476
+
477
+
478
+
479
+
480
+
481
+ <li class="md-nav__item">
482
+ <a href="../automatic_updates/" title="Automatic Updates" class="md-nav__link">
483
+ Automatic Updates
484
+ </a>
485
+ </li>
486
+
487
+
488
+
489
+
490
+
491
+
492
+
493
+ <li class="md-nav__item">
494
+ <a href="../state_storage/" title="State Storage" class="md-nav__link">
495
+ State Storage
496
+ </a>
497
+ </li>
498
+
499
+
500
+
501
+
502
+
503
+
504
+
505
+ <li class="md-nav__item">
506
+ <a href="../distributed_state_locking/" title="Distributed State Locking" class="md-nav__link">
507
+ Distributed State Locking
508
+ </a>
509
+ </li>
510
+
511
+
512
+
513
+
514
+
515
+
516
+
517
+ <li class="md-nav__item">
518
+ <a href="../remote_execution/" title="Remote Execution" class="md-nav__link">
519
+ Remote Execution
520
+ </a>
521
+ </li>
522
+
523
+
524
+
525
+
526
+
527
+
528
+
529
+
530
+
531
+ <li class="md-nav__item md-nav__item--active">
532
+
533
+ <input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
534
+
535
+
536
+
537
+
538
+ <label class="md-nav__link md-nav__link--active" for="__toc">
539
+ Interactive Commands
540
+ </label>
541
+
542
+ <a href="./" title="Interactive Commands" class="md-nav__link md-nav__link--active">
543
+ Interactive Commands
544
+ </a>
545
+
546
+
547
+ <nav class="md-nav md-nav--secondary">
548
+
549
+
550
+
551
+
552
+
553
+ <label class="md-nav__title" for="__toc">Table of contents</label>
554
+ <ul class="md-nav__list" data-md-scrollfix>
555
+
556
+ <li class="md-nav__item">
557
+ <a href="#why-interactive-commands" title="Why interactive commands?" class="md-nav__link">
558
+ Why interactive commands?
559
+ </a>
560
+
561
+ </li>
562
+
563
+ <li class="md-nav__item">
564
+ <a href="#how-to-do-it-with-rbcli" title="How to do it with Rbcli" class="md-nav__link">
565
+ How to do it with Rbcli
566
+ </a>
567
+
568
+ </li>
569
+
570
+
571
+
572
+
573
+
574
+ </ul>
575
+
576
+ </nav>
577
+
578
+ </li>
579
+
580
+
581
+ </ul>
582
+ </nav>
583
+ </li>
584
+
585
+
586
+
587
+
588
+
589
+
590
+
591
+ <li class="md-nav__item md-nav__item--nested">
592
+
593
+ <input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
594
+
595
+ <label class="md-nav__link" for="nav-5">
596
+ Development
597
+ </label>
598
+ <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
599
+ <label class="md-nav__title" for="nav-5">
600
+ Development
601
+ </label>
602
+ <ul class="md-nav__list" data-md-scrollfix>
603
+
604
+
605
+
606
+
607
+
608
+
609
+
610
+ <li class="md-nav__item">
611
+ <a href="../../development/contributing/" title="Contribution Guide" class="md-nav__link">
612
+ Contribution Guide
613
+ </a>
614
+ </li>
615
+
616
+
617
+
618
+
619
+
620
+
621
+
622
+ <li class="md-nav__item">
623
+ <a href="../../development/license/" title="License Info" class="md-nav__link">
624
+ License Info
625
+ </a>
626
+ </li>
627
+
628
+
629
+
630
+
631
+
632
+
633
+
634
+ <li class="md-nav__item">
635
+ <a href="../../development/code_of_conduct/" title="Code of Conduct" class="md-nav__link">
636
+ Code of Conduct
637
+ </a>
638
+ </li>
639
+
640
+
641
+
642
+
643
+
644
+
645
+
646
+ <li class="md-nav__item">
647
+ <a href="../../imported/changelog/" title="Changelog" class="md-nav__link">
648
+ Changelog
649
+ </a>
650
+ </li>
651
+
652
+
653
+ </ul>
654
+ </nav>
655
+ </li>
656
+
657
+
658
+
659
+
660
+
661
+
662
+
663
+ <li class="md-nav__item">
664
+ <a href="../../whoami/" title="whoami" class="md-nav__link">
665
+ whoami
666
+ </a>
667
+ </li>
668
+
669
+
670
+ </ul>
671
+ </nav>
672
+ </div>
673
+ </div>
674
+ </div>
675
+
676
+
677
+ <div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
678
+ <div class="md-sidebar__scrollwrap">
679
+ <div class="md-sidebar__inner">
680
+
681
+ <nav class="md-nav md-nav--secondary">
682
+
683
+
684
+
685
+
686
+
687
+ <label class="md-nav__title" for="__toc">Table of contents</label>
688
+ <ul class="md-nav__list" data-md-scrollfix>
689
+
690
+ <li class="md-nav__item">
691
+ <a href="#why-interactive-commands" title="Why interactive commands?" class="md-nav__link">
692
+ Why interactive commands?
693
+ </a>
694
+
695
+ </li>
696
+
697
+ <li class="md-nav__item">
698
+ <a href="#how-to-do-it-with-rbcli" title="How to do it with Rbcli" class="md-nav__link">
699
+ How to do it with Rbcli
700
+ </a>
701
+
702
+ </li>
703
+
704
+
705
+
706
+
707
+
708
+ </ul>
709
+
710
+ </nav>
711
+ </div>
712
+ </div>
713
+ </div>
714
+
715
+
716
+ <div class="md-content">
717
+ <article class="md-content__inner md-typeset">
718
+
719
+
720
+
721
+ <h1 id="interactive-commands">Interactive Commands</h1>
722
+ <h2 id="why-interactive-commands">Why interactive commands?</h2>
723
+ <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 'puts' and 'gets' 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>
724
+ <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>
725
+ <h2 id="how-to-do-it-with-rbcli">How to do it with Rbcli</h2>
726
+ <p>There is an option when declaring a command'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>
727
+ <pre><code class="ruby">class Mycmd &lt; Rbcli::Command
728
+ parameter :sort, 'Sort output alphabetically', type: :boolean, default: false, prompt: &quot;Sort output alphabetically?&quot;
729
+ action do |params, args, global_opts, config|
730
+ puts params[:sort]
731
+ end
732
+ end
733
+ </code></pre>
734
+
735
+ <p>Now, if we run the command while omitting the <code>--sort</code> parameter, as such:</p>
736
+ <pre><code class="bash">mytool mycmd
737
+ </code></pre>
738
+
739
+ <p>That should give you the prompt:</p>
740
+ <pre><code>Sort output alphabetically? (y/N):
741
+ </code></pre>
742
+
743
+ <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>
744
+ <p>String parameters behave similarly, but default to the string defined instead of a boolean value.</p>
745
+
746
+
747
+
748
+
749
+
750
+
751
+
752
+
753
+
754
+ </article>
755
+ </div>
756
+ </div>
757
+ </main>
758
+
759
+
760
+ <footer class="md-footer">
761
+
762
+ <div class="md-footer-nav">
763
+ <nav class="md-footer-nav__inner md-grid">
764
+
765
+ <a href="../remote_execution/" title="Remote Execution" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
766
+ <div class="md-flex__cell md-flex__cell--shrink">
767
+ <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
768
+ </div>
769
+ <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
770
+ <span class="md-flex__ellipsis">
771
+ <span class="md-footer-nav__direction">
772
+ Previous
773
+ </span>
774
+ Remote Execution
775
+ </span>
776
+ </div>
777
+ </a>
778
+
779
+
780
+ <a href="../../development/contributing/" title="Contribution Guide" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
781
+ <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
782
+ <span class="md-flex__ellipsis">
783
+ <span class="md-footer-nav__direction">
784
+ Next
785
+ </span>
786
+ Contribution Guide
787
+ </span>
788
+ </div>
789
+ <div class="md-flex__cell md-flex__cell--shrink">
790
+ <i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
791
+ </div>
792
+ </a>
793
+
794
+ </nav>
795
+ </div>
796
+
797
+ <div class="md-footer-meta md-typeset">
798
+ <div class="md-footer-meta__inner md-grid">
799
+ <div class="md-footer-copyright">
800
+
801
+ <div class="md-footer-copyright__highlight">
802
+ Copyright © 2018 Andrew Khoury
803
+ </div>
804
+
805
+ powered by
806
+ <a href="https://www.mkdocs.org">MkDocs</a>
807
+ and
808
+ <a href="https://squidfunk.github.io/mkdocs-material/">
809
+ Material for MkDocs</a>
810
+ </div>
811
+
812
+
813
+
814
+ </div>
815
+ </div>
816
+ </footer>
817
+
818
+ </div>
819
+
820
+ <script src="../../assets/javascripts/application.583bbe55.js"></script>
821
+
822
+ <script>app.initialize({version:"1.0.3",url:{base:"../.."}})</script>
823
+
824
+
825
+
826
+
827
+
828
+ </body>
829
+ </html>