toys 0.15.6 → 0.16.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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -1
  3. data/README.md +2 -2
  4. data/builtins/system/tools.rb +1 -1
  5. data/lib/toys/templates/clean.rb +1 -1
  6. data/lib/toys/templates/gem_build.rb +1 -1
  7. data/lib/toys/templates/rubocop.rb +4 -1
  8. data/lib/toys/version.rb +1 -1
  9. metadata +8 -63
  10. data/core-docs/toys/acceptor.rb +0 -474
  11. data/core-docs/toys/arg_parser.rb +0 -397
  12. data/core-docs/toys/cli.rb +0 -466
  13. data/core-docs/toys/compat.rb +0 -2
  14. data/core-docs/toys/completion.rb +0 -340
  15. data/core-docs/toys/context.rb +0 -386
  16. data/core-docs/toys/core.rb +0 -14
  17. data/core-docs/toys/dsl/base.rb +0 -56
  18. data/core-docs/toys/dsl/flag.rb +0 -284
  19. data/core-docs/toys/dsl/flag_group.rb +0 -267
  20. data/core-docs/toys/dsl/internal.rb +0 -4
  21. data/core-docs/toys/dsl/positional_arg.rb +0 -155
  22. data/core-docs/toys/dsl/tool.rb +0 -1639
  23. data/core-docs/toys/errors.rb +0 -126
  24. data/core-docs/toys/flag.rb +0 -560
  25. data/core-docs/toys/flag_group.rb +0 -186
  26. data/core-docs/toys/input_file.rb +0 -17
  27. data/core-docs/toys/loader.rb +0 -363
  28. data/core-docs/toys/middleware.rb +0 -336
  29. data/core-docs/toys/mixin.rb +0 -142
  30. data/core-docs/toys/module_lookup.rb +0 -75
  31. data/core-docs/toys/positional_arg.rb +0 -145
  32. data/core-docs/toys/settings.rb +0 -524
  33. data/core-docs/toys/source_info.rb +0 -271
  34. data/core-docs/toys/standard_middleware/add_verbosity_flags.rb +0 -49
  35. data/core-docs/toys/standard_middleware/apply_config.rb +0 -24
  36. data/core-docs/toys/standard_middleware/handle_usage_errors.rb +0 -33
  37. data/core-docs/toys/standard_middleware/set_default_descriptions.rb +0 -222
  38. data/core-docs/toys/standard_middleware/show_help.rb +0 -190
  39. data/core-docs/toys/standard_middleware/show_root_version.rb +0 -45
  40. data/core-docs/toys/standard_mixins/bundler.rb +0 -98
  41. data/core-docs/toys/standard_mixins/exec.rb +0 -711
  42. data/core-docs/toys/standard_mixins/fileutils.rb +0 -18
  43. data/core-docs/toys/standard_mixins/gems.rb +0 -62
  44. data/core-docs/toys/standard_mixins/git_cache.rb +0 -41
  45. data/core-docs/toys/standard_mixins/highline.rb +0 -133
  46. data/core-docs/toys/standard_mixins/pager.rb +0 -50
  47. data/core-docs/toys/standard_mixins/terminal.rb +0 -135
  48. data/core-docs/toys/standard_mixins/xdg.rb +0 -49
  49. data/core-docs/toys/template.rb +0 -112
  50. data/core-docs/toys/tool_definition.rb +0 -1079
  51. data/core-docs/toys/utils/completion_engine.rb +0 -49
  52. data/core-docs/toys/utils/exec.rb +0 -776
  53. data/core-docs/toys/utils/gems.rb +0 -185
  54. data/core-docs/toys/utils/git_cache.rb +0 -353
  55. data/core-docs/toys/utils/help_text.rb +0 -134
  56. data/core-docs/toys/utils/pager.rb +0 -118
  57. data/core-docs/toys/utils/standard_ui.rb +0 -184
  58. data/core-docs/toys/utils/terminal.rb +0 -310
  59. data/core-docs/toys/utils/xdg.rb +0 -253
  60. data/core-docs/toys/wrappable_string.rb +0 -132
  61. data/core-docs/toys-core.rb +0 -111
@@ -1,284 +0,0 @@
1
- module Toys
2
- module DSL
3
- ##
4
- # **_Defined in the toys-core gem_**
5
- #
6
- # DSL for a flag definition block. Lets you set flag attributes in a block
7
- # instead of a long series of keyword arguments.
8
- #
9
- # These directives are available inside a block passed to
10
- # {Toys::DSL::Tool#flag}.
11
- #
12
- # ### Example
13
- #
14
- # tool "mytool" do
15
- # flag :value do
16
- # # The directives in here are defined by this class
17
- # flags "--value=VAL"
18
- # accept Integer
19
- # desc "An integer value"
20
- # end
21
- # # ...
22
- # end
23
- #
24
- class Flag
25
- ##
26
- # Add flags in OptionParser format. This may be called multiple times,
27
- # and the results are cumulative.
28
- #
29
- # Following are examples of valid syntax.
30
- #
31
- # * `-a` : A short boolean switch. When this appears as an argument,
32
- # the value is set to `true`.
33
- # * `--abc` : A long boolean switch. When this appears as an argument,
34
- # the value is set to `true`.
35
- # * `-aVAL` or `-a VAL` : A short flag that takes a required value.
36
- # These two forms are treated identically. If this argument appears
37
- # with a value attached (e.g. `-afoo`), the attached string (e.g.
38
- # `"foo"`) is taken as the value. Otherwise, the following argument
39
- # is taken as the value (e.g. for `-a foo`, the value is set to
40
- # `"foo"`.) The following argument is treated as the value even if it
41
- # looks like a flag (e.g. `-a -a` causes the string `"-a"` to be
42
- # taken as the value.)
43
- # * `-a[VAL]` : A short flag that takes an optional value. If this
44
- # argument appears with a value attached (e.g. `-afoo`), the attached
45
- # string (e.g. `"foo"`) is taken as the value. Otherwise, the value
46
- # is set to `true`. The following argument is never interpreted as
47
- # the value. (Compare with `-a [VAL]`.)
48
- # * `-a [VAL]` : A short flag that takes an optional value. If this
49
- # argument appears with a value attached (e.g. `-afoo`), the attached
50
- # string (e.g. `"foo"`) is taken as the value. Otherwise, if the
51
- # following argument does not look like a flag (i.e. it does not
52
- # begin with a hyphen), it is taken as the value. (e.g. `-a foo`
53
- # causes the string `"foo"` to be taken as the value.). If there is
54
- # no following argument, or the following argument looks like a flag,
55
- # the value is set to `true`. (Compare with `-a[VAL]`.)
56
- # * `--abc=VAL` or `--abc VAL` : A long flag that takes a required
57
- # value. These two forms are treated identically. If this argument
58
- # appears with a value attached (e.g. `--abc=foo`), the attached
59
- # string (e.g. `"foo"`) is taken as the value. Otherwise, the
60
- # following argument is taken as the value (e.g. for `--abc foo`, the
61
- # value is set to `"foo"`.) The following argument is treated as the
62
- # value even if it looks like a flag (e.g. `--abc --def` causes the
63
- # string `"--def"` to be taken as the value.)
64
- # * `--abc[=VAL]` : A long flag that takes an optional value. If this
65
- # argument appears with a value attached (e.g. `--abc=foo`), the
66
- # attached string (e.g. `"foo"`) is taken as the value. Otherwise,
67
- # the value is set to `true`. The following argument is never
68
- # interpreted as the value. (Compare with `--abc [VAL]`.)
69
- # * `--abc [VAL]` : A long flag that takes an optional value. If this
70
- # argument appears with a value attached (e.g. `--abc=foo`), the
71
- # attached string (e.g. `"foo"`) is taken as the value. Otherwise, if
72
- # the following argument does not look like a flag (i.e. it does not
73
- # begin with a hyphen), it is taken as the value. (e.g. `--abc foo`
74
- # causes the string `"foo"` to be taken as the value.). If there is
75
- # no following argument, or the following argument looks like a flag,
76
- # the value is set to `true`. (Compare with `--abc=[VAL]`.)
77
- # * `--[no-]abc` : A long boolean switch that can be turned either on
78
- # or off. This effectively creates two flags, `--abc` which sets the
79
- # value to `true`, and `--no-abc` which sets the falue to `false`.
80
- #
81
- # @param flags [String...]
82
- # @return [self]
83
- #
84
- def flags(*flags)
85
- # Source available in the toys-core gem
86
- end
87
-
88
- ##
89
- # Set the acceptor for this flag's values.
90
- # You can pass either the string name of an acceptor defined in this tool
91
- # or any of its ancestors, or any other specification recognized by
92
- # {Toys::Acceptor.create}.
93
- #
94
- # @param spec [Object]
95
- # @param options [Hash]
96
- # @param block [Proc]
97
- # @return [self]
98
- #
99
- def accept(spec = nil, **options, &block)
100
- # Source available in the toys-core gem
101
- end
102
-
103
- ##
104
- # Set the default value.
105
- #
106
- # @param default [Object]
107
- # @return [self]
108
- #
109
- def default(default)
110
- # Source available in the toys-core gem
111
- end
112
-
113
- ##
114
- # Set the optional handler for setting/updating the value when a flag is
115
- # parsed. A handler should be a Proc taking two arguments, the new given
116
- # value and the previous value, and it should return the new value that
117
- # should be set. You may pass the handler as a Proc (or an object
118
- # responding to the `call` method) or you may pass a block.
119
- #
120
- # You can also pass one of the special values `:set` or `:push` as the
121
- # handler. The `:set` handler replaces the previous value (equivalent to
122
- # `-> (val, _prev) { val }`.) The `:push` handler expects the previous
123
- # value to be an array and pushes the given value onto it; it should be
124
- # combined with setting the default value to `[]` and is intended for
125
- # "multi-valued" flags.
126
- #
127
- # @param handler [Proc,:set,:push]
128
- # @param block [Proc]
129
- # @return [self]
130
- #
131
- def handler(handler = nil, &block)
132
- # Source available in the toys-core gem
133
- end
134
-
135
- ##
136
- # Set the shell completion strategy for flag names.
137
- # You can pass one of the following:
138
- #
139
- # * The string name of a completion defined in this tool or any of its
140
- # ancestors.
141
- # * A hash of options to pass to the constructor of
142
- # {Toys::Flag::DefaultCompletion}.
143
- # * `nil` or `:default` to select the standard completion strategy
144
- # (which is {Toys::Flag::DefaultCompletion} with no extra options).
145
- # * Any other specification recognized by {Toys::Completion.create}.
146
- #
147
- # @param spec [Object]
148
- # @param options [Hash]
149
- # @param block [Proc]
150
- # @return [self]
151
- #
152
- def complete_flags(spec = nil, **options, &block)
153
- # Source available in the toys-core gem
154
- end
155
-
156
- ##
157
- # Set the shell completion strategy for flag values.
158
- # You can pass either the string name of a completion defined in this
159
- # tool or any of its ancestors, or any other specification recognized by
160
- # {Toys::Completion.create}.
161
- #
162
- # @param spec [Object]
163
- # @param options [Hash]
164
- # @param block [Proc]
165
- # @return [self]
166
- #
167
- def complete_values(spec = nil, **options, &block)
168
- # Source available in the toys-core gem
169
- end
170
-
171
- ##
172
- # Set whether to raise an exception if a flag is requested that is
173
- # already in use or marked as disabled.
174
- #
175
- # @param setting [Boolean]
176
- # @return [self]
177
- #
178
- def report_collisions(setting)
179
- # Source available in the toys-core gem
180
- end
181
-
182
- ##
183
- # Set the short description for the current flag. The short description
184
- # is displayed with the flag in online help.
185
- #
186
- # The description is a {Toys::WrappableString}, which may be word-wrapped
187
- # when displayed in a help screen. You may pass a {Toys::WrappableString}
188
- # directly to this method, or you may pass any input that can be used to
189
- # construct a wrappable string:
190
- #
191
- # * If you pass a String, its whitespace will be compacted (i.e. tabs,
192
- # newlines, and multiple consecutive whitespace will be turned into a
193
- # single space), and it will be word-wrapped on whitespace.
194
- # * If you pass an Array of Strings, each string will be considered a
195
- # literal word that cannot be broken, and wrapping will be done
196
- # across the strings in the array. In this case, whitespace is not
197
- # compacted.
198
- #
199
- # ### Examples
200
- #
201
- # If you pass in a sentence as a simple string, it may be word wrapped
202
- # when displayed:
203
- #
204
- # desc "This sentence may be wrapped."
205
- #
206
- # To specify a sentence that should never be word-wrapped, pass it as the
207
- # sole element of a string array:
208
- #
209
- # desc ["This sentence will not be wrapped."]
210
- #
211
- # @param desc [String,Array<String>,Toys::WrappableString]
212
- # @return [self]
213
- #
214
- def desc(desc)
215
- # Source available in the toys-core gem
216
- end
217
-
218
- ##
219
- # Add to the long description for the current flag. The long description
220
- # is displayed with the flag in online help. This directive may be given
221
- # multiple times, and the results are cumulative.
222
- #
223
- # A long description is a series of descriptions, which are generally
224
- # displayed in a series of lines/paragraphs. Each individual description
225
- # uses the form described in the {#desc} documentation, and may be
226
- # word-wrapped when displayed. To insert a blank line, include an empty
227
- # string as one of the descriptions.
228
- #
229
- # ### Example
230
- #
231
- # long_desc "This initial paragraph might get word wrapped.",
232
- # "This next paragraph is followed by a blank line.",
233
- # "",
234
- # ["This line will not be wrapped."],
235
- # [" This indent is preserved."]
236
- # long_desc "This line is appended to the description."
237
- #
238
- # @param long_desc [String,Array<String>,Toys::WrappableString...]
239
- # @return [self]
240
- #
241
- def long_desc(*long_desc)
242
- # Source available in the toys-core gem
243
- end
244
-
245
- ##
246
- # Set the group. A group may be set by name or group object. Setting
247
- # `nil` selects the default group.
248
- #
249
- # @param group [String,Symbol,Toys::FlagGroup,nil]
250
- # @return [self]
251
- #
252
- def group(group)
253
- # Source available in the toys-core gem
254
- end
255
-
256
- ##
257
- # Set the display name for this flag. This may be used in help text and
258
- # error messages.
259
- #
260
- # @param display_name [String]
261
- # @return [self]
262
- #
263
- def display_name(display_name)
264
- # Source available in the toys-core gem
265
- end
266
-
267
- ##
268
- # Specify whether to add a method for this flag.
269
- #
270
- # Recognized values are true to force creation of a method, false to
271
- # disable method creation, and nil for the default behavior. The default
272
- # checks the name and adds a method if the name is a symbol representing
273
- # a legal method name that starts with a letter and does not override any
274
- # public method in the Ruby Object class or collide with any method
275
- # directly defined in the tool class.
276
- #
277
- # @param value [true,false,nil]
278
- #
279
- def add_method(value)
280
- # Source available in the toys-core gem
281
- end
282
- end
283
- end
284
- end
@@ -1,267 +0,0 @@
1
- module Toys
2
- module DSL
3
- ##
4
- # **_Defined in the toys-core gem_**
5
- #
6
- # DSL for a flag group definition block. Lets you create flags in a group.
7
- #
8
- # These directives are available inside a block passed to
9
- # {Toys::DSL::Tool#flag_group}, {Toys::DSL::Tool#all_required},
10
- # {Toys::DSL::Tool#at_most_one}, {Toys::DSL::Tool#at_least_one}, or
11
- # {Toys::DSL::Tool#exactly_one}.
12
- #
13
- # ### Example
14
- #
15
- # tool "login" do
16
- # all_required do
17
- # # The directives in here are defined by this class
18
- # flag :username, "--username=VAL", desc: "Set username (required)"
19
- # flag :password, "--password=VAL", desc: "Set password (required)"
20
- # end
21
- # # ...
22
- # end
23
- #
24
- class FlagGroup
25
- ##
26
- # Add a flag to the current group. Each flag must specify a key which
27
- # the script may use to obtain the flag value from the context.
28
- # You may then provide the flags themselves in OptionParser form.
29
- #
30
- # If the given key is a symbol representing a valid method name, then a
31
- # helper method is automatically added to retrieve the value. Otherwise,
32
- # if the key is a string or does not represent a valid method name, the
33
- # tool can retrieve the value by calling {Toys::Context#get}.
34
- #
35
- # Attributes of the flag may be passed in as arguments to this method, or
36
- # set in a block passed to this method. If you provide a block, you can
37
- # use directives in {Toys::DSL::Flag} within the block.
38
- #
39
- # ### Flag syntax
40
- #
41
- # The flags themselves should be provided in OptionParser form. Following
42
- # are examples of valid syntax.
43
- #
44
- # * `-a` : A short boolean switch. When this appears as an argument,
45
- # the value is set to `true`.
46
- # * `--abc` : A long boolean switch. When this appears as an argument,
47
- # the value is set to `true`.
48
- # * `-aVAL` or `-a VAL` : A short flag that takes a required value.
49
- # These two forms are treated identically. If this argument appears
50
- # with a value attached (e.g. `-afoo`), the attached string (e.g.
51
- # `"foo"`) is taken as the value. Otherwise, the following argument
52
- # is taken as the value (e.g. for `-a foo`, the value is set to
53
- # `"foo"`.) The following argument is treated as the value even if it
54
- # looks like a flag (e.g. `-a -a` causes the string `"-a"` to be
55
- # taken as the value.)
56
- # * `-a[VAL]` : A short flag that takes an optional value. If this
57
- # argument appears with a value attached (e.g. `-afoo`), the attached
58
- # string (e.g. `"foo"`) is taken as the value. Otherwise, the value
59
- # is set to `true`. The following argument is never interpreted as
60
- # the value. (Compare with `-a [VAL]`.)
61
- # * `-a [VAL]` : A short flag that takes an optional value. If this
62
- # argument appears with a value attached (e.g. `-afoo`), the attached
63
- # string (e.g. `"foo"`) is taken as the value. Otherwise, if the
64
- # following argument does not look like a flag (i.e. it does not
65
- # begin with a hyphen), it is taken as the value. (e.g. `-a foo`
66
- # causes the string `"foo"` to be taken as the value.). If there is
67
- # no following argument, or the following argument looks like a flag,
68
- # the value is set to `true`. (Compare with `-a[VAL]`.)
69
- # * `--abc=VAL` or `--abc VAL` : A long flag that takes a required
70
- # value. These two forms are treated identically. If this argument
71
- # appears with a value attached (e.g. `--abc=foo`), the attached
72
- # string (e.g. `"foo"`) is taken as the value. Otherwise, the
73
- # following argument is taken as the value (e.g. for `--abc foo`, the
74
- # value is set to `"foo"`.) The following argument is treated as the
75
- # value even if it looks like a flag (e.g. `--abc --def` causes the
76
- # string `"--def"` to be taken as the value.)
77
- # * `--abc[=VAL]` : A long flag that takes an optional value. If this
78
- # argument appears with a value attached (e.g. `--abc=foo`), the
79
- # attached string (e.g. `"foo"`) is taken as the value. Otherwise,
80
- # the value is set to `true`. The following argument is never
81
- # interpreted as the value. (Compare with `--abc [VAL]`.)
82
- # * `--abc [VAL]` : A long flag that takes an optional value. If this
83
- # argument appears with a value attached (e.g. `--abc=foo`), the
84
- # attached string (e.g. `"foo"`) is taken as the value. Otherwise, if
85
- # the following argument does not look like a flag (i.e. it does not
86
- # begin with a hyphen), it is taken as the value. (e.g. `--abc foo`
87
- # causes the string `"foo"` to be taken as the value.). If there is
88
- # no following argument, or the following argument looks like a flag,
89
- # the value is set to `true`. (Compare with `--abc=[VAL]`.)
90
- # * `--[no-]abc` : A long boolean switch that can be turned either on
91
- # or off. This effectively creates two flags, `--abc` which sets the
92
- # value to `true`, and `--no-abc` which sets the falue to `false`.
93
- #
94
- # ### Default flag syntax
95
- #
96
- # If no flag syntax strings are provided, a default syntax will be
97
- # inferred based on the key and other options.
98
- #
99
- # Specifically, if the key has one character, then that character will be
100
- # chosen as a short flag. If the key has multiple characters, a long flag
101
- # will be generated.
102
- #
103
- # Furthermore, if a custom completion, a non-boolean acceptor, or a
104
- # non-boolean default value is provided in the options, then the flag
105
- # will be considered to take a value. Otherwise, it will be considered to
106
- # be a boolean switch.
107
- #
108
- # For example, the following pairs of flags are identical:
109
- #
110
- # flag :a
111
- # flag :a, "-a"
112
- #
113
- # flag :abc_def
114
- # flag :abc_def, "--abc-def"
115
- #
116
- # flag :number, accept: Integer
117
- # flag :number, "--number=VAL", accept: Integer
118
- #
119
- # ### More examples
120
- #
121
- # A flag that sets its value to the number of times it appears on the
122
- # command line:
123
- #
124
- # flag :verbose, "-v", "--verbose",
125
- # default: 0, handler: ->(_val, count) { count + 1 }
126
- #
127
- # An example using block form:
128
- #
129
- # flag :shout do
130
- # flags "-s", "--shout"
131
- # default false
132
- # desc "Say it louder"
133
- # long_desc "This flag says it lowder.",
134
- # "You might use this when people can't hear you.",
135
- # "",
136
- # "Example:",
137
- # [" toys say --shout hello"]
138
- # end
139
- #
140
- # @param key [String,Symbol] The key to use to retrieve the value from
141
- # the execution context.
142
- # @param flags [String...] The flags in OptionParser format.
143
- # @param accept [Object] An acceptor that validates and/or converts the
144
- # value. You may provide either the name of an acceptor you have
145
- # defined, or one of the default acceptors provided by OptionParser.
146
- # Optional. If not specified, accepts any value as a string.
147
- # @param default [Object] The default value. This is the value that will
148
- # be set in the context if this flag is not provided on the command
149
- # line. Defaults to `nil`.
150
- # @param handler [Proc,nil,:set,:push] An optional handler for
151
- # setting/updating the value. A handler is a proc taking two
152
- # arguments, the given value and the previous value, returning the
153
- # new value that should be set. You may also specify a predefined
154
- # named handler. The `:set` handler (the default) replaces the
155
- # previous value (effectively `-> (val, _prev) { val }`). The
156
- # `:push` handler expects the previous value to be an array and
157
- # pushes the given value onto it; it should be combined with setting
158
- # `default: []` and is intended for "multi-valued" flags.
159
- # @param complete_flags [Object] A specifier for shell tab completion
160
- # for flag names associated with this flag. By default, a
161
- # {Toys::Flag::DefaultCompletion} is used, which provides the flag's
162
- # names as completion candidates. To customize completion, set this
163
- # to the name of a previously defined completion, a hash of options
164
- # to pass to the constructor for {Toys::Flag::DefaultCompletion}, or
165
- # any other spec recognized by {Toys::Completion.create}.
166
- # @param complete_values [Object] A specifier for shell tab completion
167
- # for flag values associated with this flag. This is the empty
168
- # completion by default. To customize completion, set this to the
169
- # name of a previously defined completion, or any spec recognized by
170
- # {Toys::Completion.create}.
171
- # @param report_collisions [Boolean] Raise an exception if a flag is
172
- # requested that is already in use or marked as unusable. Default is
173
- # true.
174
- # @param desc [String,Array<String>,Toys::WrappableString] Short
175
- # description for the flag. See {Toys::DSL::Tool#desc} for a
176
- # description of the allowed formats. Defaults to the empty string.
177
- # @param long_desc [Array<String,Array<String>,Toys::WrappableString>]
178
- # Long description for the flag. See {Toys::DSL::Tool#long_desc} for
179
- # a description of the allowed formats. (But note that this param
180
- # takes an Array of description lines, rather than a series of
181
- # arguments.) Defaults to the empty array.
182
- # @param display_name [String] A display name for this flag, used in help
183
- # text and error messages.
184
- # @param add_method [true,false,nil] Whether to add a method for this
185
- # flag. If omitted or set to nil, uses the default behavior, which
186
- # adds the method if the key is a symbol representing a legal method
187
- # name that starts with a letter and does not override any public
188
- # method in the Ruby Object class or collide with any method directly
189
- # defined in the tool class.
190
- # @param block [Proc] Configures the flag. See {Toys::DSL::Flag} for the
191
- # directives that can be called in this block.
192
- # @return [self]
193
- #
194
- def flag(key, *flags,
195
- accept: nil, default: nil, handler: nil,
196
- complete_flags: nil, complete_values: nil,
197
- report_collisions: true, desc: nil, long_desc: nil,
198
- display_name: nil, add_method: nil,
199
- &block)
200
- # Source available in the toys-core gem
201
- end
202
-
203
- ##
204
- # Set the short description for the current flag group. The short
205
- # description is displayed as the group title in online help.
206
- #
207
- # The description is a {Toys::WrappableString}, which may be word-wrapped
208
- # when displayed in a help screen. You may pass a {Toys::WrappableString}
209
- # directly to this method, or you may pass any input that can be used to
210
- # construct a wrappable string:
211
- #
212
- # * If you pass a String, its whitespace will be compacted (i.e. tabs,
213
- # newlines, and multiple consecutive whitespace will be turned into a
214
- # single space), and it will be word-wrapped on whitespace.
215
- # * If you pass an Array of Strings, each string will be considered a
216
- # literal word that cannot be broken, and wrapping will be done
217
- # across the strings in the array. In this case, whitespace is not
218
- # compacted.
219
- #
220
- # ### Examples
221
- #
222
- # If you pass in a sentence as a simple string, it may be word wrapped
223
- # when displayed:
224
- #
225
- # desc "This sentence may be wrapped."
226
- #
227
- # To specify a sentence that should never be word-wrapped, pass it as the
228
- # sole element of a string array:
229
- #
230
- # desc ["This sentence will not be wrapped."]
231
- #
232
- # @param desc [String,Array<String>,Toys::WrappableString]
233
- # @return [self]
234
- #
235
- def desc(desc)
236
- # Source available in the toys-core gem
237
- end
238
-
239
- ##
240
- # Add to the long description for the current flag group. The long
241
- # description is displayed with the flag group in online help. This
242
- # directive may be given multiple times, and the results are cumulative.
243
- #
244
- # A long description is a series of descriptions, which are generally
245
- # displayed in a series of lines/paragraphs. Each individual description
246
- # uses the form described in the {#desc} documentation, and may be
247
- # word-wrapped when displayed. To insert a blank line, include an empty
248
- # string as one of the descriptions.
249
- #
250
- # ### Example
251
- #
252
- # long_desc "This initial paragraph might get word wrapped.",
253
- # "This next paragraph is followed by a blank line.",
254
- # "",
255
- # ["This line will not be wrapped."],
256
- # [" This indent is preserved."]
257
- # long_desc "This line is appended to the description."
258
- #
259
- # @param long_desc [String,Array<String>,Toys::WrappableString...]
260
- # @return [self]
261
- #
262
- def long_desc(*long_desc)
263
- # Source available in the toys-core gem
264
- end
265
- end
266
- end
267
- end
@@ -1,4 +0,0 @@
1
- module Toys
2
- module DSL
3
- end
4
- end