tsumanne 0.0.0 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,313 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `mixlib-cli` gem.
5
+ # Please instead update this file by running `bin/tapioca gem mixlib-cli`.
6
+
7
+ # source://mixlib-cli//lib/mixlib/cli/formatter.rb#2
8
+ module Mixlib; end
9
+
10
+ # == Mixlib::CLI
11
+ # Adds a DSL for defining command line options and methods for parsing those
12
+ # options to the including class.
13
+ #
14
+ # Mixlib::CLI does some setup in #initialize, so the including class must
15
+ # call `super()` if it defines a custom initializer.
16
+ #
17
+ # === DSL
18
+ # When included, Mixlib::CLI also extends the including class with its
19
+ # ClassMethods, which define the DSL. The primary methods of the DSL are
20
+ # ClassMethods#option, which defines a command line option;
21
+ # ClassMethods#banner, which defines the "usage" banner;
22
+ # and ClassMethods#deprecated_option, which defines a deprecated command-line option.
23
+ #
24
+ # === Parsing
25
+ # Command line options are parsed by calling the instance method
26
+ # #parse_options. After calling this method, the attribute #config will
27
+ # contain a hash of `:option_name => value` pairs.
28
+ #
29
+ # source://mixlib-cli//lib/mixlib/cli/formatter.rb#3
30
+ module Mixlib::CLI
31
+ mixes_in_class_methods ::Mixlib::CLI::ClassMethods
32
+ mixes_in_class_methods ::Mixlib::CLI::InheritMethods
33
+
34
+ # Create a new Mixlib::CLI class. If you override this, make sure you call super!
35
+ #
36
+ # === Parameters
37
+ # *args<Array>:: The array of arguments passed to the initializer
38
+ #
39
+ # === Returns
40
+ # object<Mixlib::Config>:: Returns an instance of whatever you wanted :)
41
+ #
42
+ # source://mixlib-cli//lib/mixlib/cli.rb#260
43
+ def initialize(*args); end
44
+
45
+ # Banner for the option parser. If the option parser is printed, e.g., by
46
+ # `puts opt_parser`, this string will be used as the first line.
47
+ #
48
+ # source://mixlib-cli//lib/mixlib/cli.rb#251
49
+ def banner; end
50
+
51
+ # Banner for the option parser. If the option parser is printed, e.g., by
52
+ # `puts opt_parser`, this string will be used as the first line.
53
+ #
54
+ # source://mixlib-cli//lib/mixlib/cli.rb#251
55
+ def banner=(_arg0); end
56
+
57
+ # source://mixlib-cli//lib/mixlib/cli.rb#432
58
+ def build_option_arguments(opt_setting); end
59
+
60
+ # Any arguments which were not parsed and placed in "config"--the leftovers.
61
+ #
62
+ # source://mixlib-cli//lib/mixlib/cli.rb#247
63
+ def cli_arguments; end
64
+
65
+ # Any arguments which were not parsed and placed in "config"--the leftovers.
66
+ #
67
+ # source://mixlib-cli//lib/mixlib/cli.rb#247
68
+ def cli_arguments=(_arg0); end
69
+
70
+ # A Hash containing the values supplied by command line options.
71
+ #
72
+ # The behavior and contents of this Hash vary depending on whether
73
+ # ClassMethods#use_separate_default_options is enabled.
74
+ # ==== use_separate_default_options *disabled*
75
+ # After initialization, +config+ will contain any default values defined
76
+ # via the mixlib-config DSL. When #parse_options is called, user-supplied
77
+ # values (from ARGV) will be merged in.
78
+ # ==== use_separate_default_options *enabled*
79
+ # After initialization, this will be an empty hash. When #parse_options is
80
+ # called, +config+ is populated *only* with user-supplied values.
81
+ #
82
+ # source://mixlib-cli//lib/mixlib/cli.rb#236
83
+ def config; end
84
+
85
+ # A Hash containing the values supplied by command line options.
86
+ #
87
+ # The behavior and contents of this Hash vary depending on whether
88
+ # ClassMethods#use_separate_default_options is enabled.
89
+ # ==== use_separate_default_options *disabled*
90
+ # After initialization, +config+ will contain any default values defined
91
+ # via the mixlib-config DSL. When #parse_options is called, user-supplied
92
+ # values (from ARGV) will be merged in.
93
+ # ==== use_separate_default_options *enabled*
94
+ # After initialization, this will be an empty hash. When #parse_options is
95
+ # called, +config+ is populated *only* with user-supplied values.
96
+ #
97
+ # source://mixlib-cli//lib/mixlib/cli.rb#236
98
+ def config=(_arg0); end
99
+
100
+ # If ClassMethods#use_separate_default_options is enabled, this will be a
101
+ # Hash containing key value pairs of `:option_name => default_value`
102
+ # (populated during object initialization).
103
+ #
104
+ # If use_separate_default_options is disabled, it will always be an empty
105
+ # hash.
106
+ #
107
+ # source://mixlib-cli//lib/mixlib/cli.rb#244
108
+ def default_config; end
109
+
110
+ # If ClassMethods#use_separate_default_options is enabled, this will be a
111
+ # Hash containing key value pairs of `:option_name => default_value`
112
+ # (populated during object initialization).
113
+ #
114
+ # If use_separate_default_options is disabled, it will always be an empty
115
+ # hash.
116
+ #
117
+ # source://mixlib-cli//lib/mixlib/cli.rb#244
118
+ def default_config=(_arg0); end
119
+
120
+ # Iterates through options declared as deprecated,
121
+ # maps values to their replacement options,
122
+ # and prints deprecation warnings.
123
+ #
124
+ # @return NilClass
125
+ #
126
+ # source://mixlib-cli//lib/mixlib/cli.rb#394
127
+ def handle_deprecated_options(show_deprecations); end
128
+
129
+ # The option parser generated from the mixlib-cli DSL. +opt_parser+ can be
130
+ # used to print a help message including the banner and any CLI options via
131
+ # `puts opt_parser`.
132
+ # === Returns
133
+ # opt_parser<OptionParser>:: The option parser object.
134
+ #
135
+ # source://mixlib-cli//lib/mixlib/cli.rb#344
136
+ def opt_parser; end
137
+
138
+ # Gives the command line options definition as configured in the DSL. These
139
+ # are used by #parse_options to generate the option parsing code. To get
140
+ # the values supplied by the user, see #config.
141
+ #
142
+ # source://mixlib-cli//lib/mixlib/cli.rb#223
143
+ def options; end
144
+
145
+ # Gives the command line options definition as configured in the DSL. These
146
+ # are used by #parse_options to generate the option parsing code. To get
147
+ # the values supplied by the user, see #config.
148
+ #
149
+ # source://mixlib-cli//lib/mixlib/cli.rb#223
150
+ def options=(_arg0); end
151
+
152
+ # Parses an array, by default ARGV, for command line options (as configured at
153
+ # the class level).
154
+ # === Parameters
155
+ # argv<Array>:: The array of arguments to parse; defaults to ARGV
156
+ #
157
+ # === Returns
158
+ # argv<Array>:: Returns any un-parsed elements.
159
+ #
160
+ # source://mixlib-cli//lib/mixlib/cli.rb#304
161
+ def parse_options(argv = T.unsafe(nil), show_deprecations: T.unsafe(nil)); end
162
+
163
+ class << self
164
+ # @private
165
+ #
166
+ # source://mixlib-cli//lib/mixlib/cli.rb#448
167
+ def included(receiver); end
168
+ end
169
+ end
170
+
171
+ # source://mixlib-cli//lib/mixlib/cli.rb#81
172
+ module Mixlib::CLI::ClassMethods
173
+ # Change the banner. Defaults to:
174
+ # Usage: #{0} (options)
175
+ #
176
+ # === Parameters
177
+ # bstring<String>:: The string to set the banner to
178
+ #
179
+ # === Returns
180
+ # @banner<String>:: The current banner
181
+ #
182
+ # source://mixlib-cli//lib/mixlib/cli.rb#210
183
+ def banner(bstring = T.unsafe(nil)); end
184
+
185
+ # Declare a deprecated option
186
+ #
187
+ # Add a deprecated command line option.
188
+ #
189
+ # name<Symbol> :: The name of the deprecated option
190
+ # replacement<Symbol> :: The name of the option that replaces this option.
191
+ # long<String> :: The original long flag name, or flag name with argument, eg "--user USER"
192
+ # short<String> :: The original short-form flag name, eg "-u USER"
193
+ # boolean<String> :: true if this is a boolean flag, eg "--[no-]option".
194
+ # value_mapper<Proc/1> :: a block that accepts the original value from the deprecated option,
195
+ # and converts it to a value suitable for the new option.
196
+ # If not provided, the value provided to the deprecated option will be
197
+ # assigned directly to the converted option.
198
+ # keep<Boolean> :: Defaults to true, this ensures that `options[:deprecated_flag]` is
199
+ # populated when the deprecated flag is used. If set to false,
200
+ # only the value in `replacement` will be set. Results undefined
201
+ # if no replacement is provided. You can use this to enforce the transition
202
+ # to non-deprecated keys in your code.
203
+ #
204
+ # === Returns
205
+ # <Hash> :: The config hash for the created option.
206
+ #
207
+ # source://mixlib-cli//lib/mixlib/cli.rb#151
208
+ def deprecated_option(name, replacement: T.unsafe(nil), long: T.unsafe(nil), short: T.unsafe(nil), boolean: T.unsafe(nil), value_mapper: T.unsafe(nil), keep: T.unsafe(nil)); end
209
+
210
+ # Add a command line option.
211
+ #
212
+ # === Parameters
213
+ # name<Symbol>:: The name of the option to add
214
+ # args<Hash>:: A hash of arguments for the option, specifying how it should be parsed.
215
+ # Supported arguments:
216
+ # :short - The short option, just like from optparse. Example: "-l LEVEL"
217
+ # :long - The long option, just like from optparse. Example: "--level LEVEL"
218
+ # :description - The description for this item, just like from optparse.
219
+ # :default - A default value for this option. Default values will be populated
220
+ # on parse into `config` or `default_default`, depending `use_separate_defaults`
221
+ # :boolean - indicates the flag is a boolean. You can use this if the flag takes no arguments
222
+ # The config value will be set to 'true' if the flag is provided on the CLI and this
223
+ # argument is set to true. The config value will be set to false only
224
+ # if it has a default value of false
225
+ # :required - When set, the option is required. If the command is run without this option,
226
+ # it will print a message informing the user of the missing requirement, and exit. Default is false.
227
+ # :proc - Proc that will be invoked if the human has specified this option.
228
+ # Two forms are supported:
229
+ # Proc/1 - provided value is passed in.
230
+ # Proc/2 - first argument is provided value. Second is the cli flag option hash.
231
+ # Both versions return the value to be assigned to the option.
232
+ # :show_options - this option is designated as one that shows all supported options/help when invoked.
233
+ # :exit - exit your program with the exit code when this option is given. Example: 0
234
+ # :in - array containing a list of valid values. The value provided at run-time for the option is
235
+ # validated against this. If it is not in the list, it will print a message and exit.
236
+ # :on :head OR :tail - force this option to display at the beginning or end of the
237
+ # option list, respectively
238
+ # =
239
+ # i
240
+ #
241
+ # @raise [ArgumentError]
242
+ # @return [Hash] :: the config hash for the created option
243
+ #
244
+ # source://mixlib-cli//lib/mixlib/cli.rb#123
245
+ def option(name, args); end
246
+
247
+ # Get the hash of current options.
248
+ #
249
+ # === Returns
250
+ # @options<Hash>:: The current options hash.
251
+ #
252
+ # source://mixlib-cli//lib/mixlib/cli.rb#184
253
+ def options; end
254
+
255
+ # Set the current options hash
256
+ #
257
+ # === Parameters
258
+ # val<Hash>:: The hash to set the options to
259
+ #
260
+ # === Returns
261
+ # @options<Hash>:: The current options hash.
262
+ #
263
+ # @raise [ArgumentError]
264
+ #
265
+ # source://mixlib-cli//lib/mixlib/cli.rb#196
266
+ def options=(val); end
267
+
268
+ # When this setting is set to +true+, default values supplied to the
269
+ # mixlib-cli DSL will be stored in a separate Hash
270
+ #
271
+ # source://mixlib-cli//lib/mixlib/cli.rb#84
272
+ def use_separate_default_options(true_or_false); end
273
+
274
+ # @return [Boolean]
275
+ #
276
+ # source://mixlib-cli//lib/mixlib/cli.rb#88
277
+ def use_separate_defaults?; end
278
+ end
279
+
280
+ # source://mixlib-cli//lib/mixlib/cli/formatter.rb#4
281
+ class Mixlib::CLI::Formatter
282
+ class << self
283
+ # Create a string that includes both versions (short/long) of a flag name
284
+ # based on on whether short/long/both/neither are provided
285
+ #
286
+ # @param short [String] the short name of the option. Can be nil.
287
+ # @param long [String] the long name of the option. Can be nil.
288
+ # @return [String] the formatted flag name as described above
289
+ #
290
+ # source://mixlib-cli//lib/mixlib/cli/formatter.rb#11
291
+ def combined_option_display_name(short, long); end
292
+
293
+ # @param opt_array [Array]
294
+ # @return [String] a friendly quoted list of items complete with "or"
295
+ #
296
+ # source://mixlib-cli//lib/mixlib/cli/formatter.rb#25
297
+ def friendly_opt_list(opt_array); end
298
+ end
299
+ end
300
+
301
+ # source://mixlib-cli//lib/mixlib/cli.rb#43
302
+ module Mixlib::CLI::InheritMethods
303
+ # object:: Instance to clone
304
+ # This method will return a "deep clone" of the provided
305
+ # `object`. If the provided `object` is an enumerable type the
306
+ # contents will be iterated and cloned as well.
307
+ #
308
+ # source://mixlib-cli//lib/mixlib/cli.rb#53
309
+ def deep_dup(object); end
310
+
311
+ # source://mixlib-cli//lib/mixlib/cli.rb#44
312
+ def inherited(receiver); end
313
+ end