stdlib/optparse/0/optparse.rbs in rbs-3.0.0.dev.2 vs stdlib/optparse/0/optparse.rbs in rbs-3.0.0.dev.3
- old
+ new
@@ -537,16 +537,16 @@
# <!--
# rdoc-file=lib/optparse.rb
# - define(*params, &block)
# -->
# Creates an option from the given parameters `params`. See [Parameters for New
- # Options](./option_params.rdoc).
+ # Options](optparse/option_params.rdoc).
#
# The block, if given, is the handler for the created option. When the option is
# encountered during command-line parsing, the block is called with the argument
# given for the option, if any. See [Option
- # Handlers](./option_params.rdoc#label-Option+Handlers).
+ # Handlers](optparse/option_params.rdoc#label-Option+Handlers).
#
def define: (*String params) ?{ (*untyped) -> untyped } -> untyped
| (String params, Class | Array[String] | Hash[Symbol, untyped] | Regexp obj, ?String desc) ?{ (*untyped) -> untyped } -> untyped
| (*String params, Proc | Method handler) -> untyped
| (String params, Class | Array[String] | Hash[Symbol, untyped] | Regexp obj, ?String desc, Proc | Method handler) -> untyped
@@ -554,16 +554,16 @@
# <!--
# rdoc-file=lib/optparse.rb
# - define_head(*params, &block)
# -->
# Creates an option from the given parameters `params`. See [Parameters for New
- # Options](./option_params.rdoc).
+ # Options](optparse/option_params.rdoc).
#
# The block, if given, is the handler for the created option. When the option is
# encountered during command-line parsing, the block is called with the argument
# given for the option, if any. See [Option
- # Handlers](./option_params.rdoc#label-Option+Handlers).
+ # Handlers](optparse/option_params.rdoc#label-Option+Handlers).
#
def define_head: (*String params) ?{ (*untyped) -> untyped } -> untyped
| (String params, Class | Array[String] | Hash[Symbol, untyped] | Regexp obj, ?String desc) ?{ (*untyped) -> untyped } -> untyped
| (*String params, Proc | Method handler) -> untyped
| (String params, Class | Array[String] | Hash[Symbol, untyped] | Regexp obj, ?String desc, Proc | Method handler) -> untyped
@@ -571,16 +571,16 @@
# <!--
# rdoc-file=lib/optparse.rb
# - define_tail(*params, &block)
# -->
# Creates an option from the given parameters `params`. See [Parameters for New
- # Options](./option_params.rdoc).
+ # Options](optparse/option_params.rdoc).
#
# The block, if given, is the handler for the created option. When the option is
# encountered during command-line parsing, the block is called with the argument
# given for the option, if any. See [Option
- # Handlers](./option_params.rdoc#label-Option+Handlers).
+ # Handlers](optparse/option_params.rdoc#label-Option+Handlers).
#
def define_tail: (*String params) ?{ (*untyped) -> untyped } -> untyped
| (String params, Class | Array[String] | Hash[Symbol, untyped] | Regexp obj, ?String desc) ?{ (*untyped) -> untyped } -> untyped
| (*String params, Proc | Method handler) -> untyped
| (String params, Class | Array[String] | Hash[Symbol, untyped] | Regexp obj, ?String desc, Proc | Method handler) -> untyped
@@ -627,32 +627,35 @@
#
def inc: (*untyped args) -> untyped
# <!--
# rdoc-file=lib/optparse.rb
- # - load(filename = nil)
+ # - load(filename = nil, into: nil)
# -->
# Loads options from file names as `filename`. Does nothing when the file is not
# present. Returns whether successfully loaded.
#
# `filename` defaults to basename of the program without suffix in a directory
# ~/.options, then the basename with '.options' suffix under XDG and Haiku
# standard places.
#
+ # The optional `into` keyword argument works exactly like that accepted in
+ # method #parse.
+ #
def load: (?String filename) -> bool
# <!--
# rdoc-file=lib/optparse.rb
# - make_switch(params, block = nil)
# -->
# Creates an option from the given parameters `params`. See [Parameters for New
- # Options](./option_params.rdoc).
+ # Options](optparse/option_params.rdoc).
#
# The block, if given, is the handler for the created option. When the option is
# encountered during command-line parsing, the block is called with the argument
# given for the option, if any. See [Option
- # Handlers](./option_params.rdoc#label-Option+Handlers).
+ # Handlers](optparse/option_params.rdoc#label-Option+Handlers).
#
def make_switch: (Array[untyped] opts, ?Proc block) -> [ untyped, untyped, untyped, untyped, untyped ]
# <!--
# rdoc-file=lib/optparse.rb
@@ -666,16 +669,16 @@
# <!--
# rdoc-file=lib/optparse.rb
# - on(*params, &block)
# -->
# Creates an option from the given parameters `params`. See [Parameters for New
- # Options](./option_params.rdoc).
+ # Options](optparse/option_params.rdoc).
#
# The block, if given, is the handler for the created option. When the option is
# encountered during command-line parsing, the block is called with the argument
# given for the option, if any. See [Option
- # Handlers](./option_params.rdoc#label-Option+Handlers).
+ # Handlers](optparse/option_params.rdoc#label-Option+Handlers).
#
def on: (*String params) ?{ (*untyped) -> untyped } -> self
| (String params, Class | Array[String] | Hash[Symbol, untyped] | Regexp obj, ?String desc) ?{ (*untyped) -> untyped } -> self
| (String short_params, String long_params, Class | Array[String] | Hash[Symbol, untyped] | Regexp obj, ?String desc) ?{ (*untyped) -> untyped } -> self
| (*String params, Proc | Method handler) -> self
@@ -685,16 +688,16 @@
# <!--
# rdoc-file=lib/optparse.rb
# - on_head(*params, &block)
# -->
# Creates an option from the given parameters `params`. See [Parameters for New
- # Options](./option_params.rdoc).
+ # Options](optparse/option_params.rdoc).
#
# The block, if given, is the handler for the created option. When the option is
# encountered during command-line parsing, the block is called with the argument
# given for the option, if any. See [Option
- # Handlers](./option_params.rdoc#label-Option+Handlers).
+ # Handlers](optparse/option_params.rdoc#label-Option+Handlers).
#
# The new option is added at the head of the summary.
#
def on_head: (*String params) ?{ (*untyped) -> untyped } -> self
| (String params, Class | Array[String] | Hash[Symbol, untyped] | Regexp obj, ?String desc) ?{ (*untyped) -> untyped } -> self
@@ -706,16 +709,16 @@
# <!--
# rdoc-file=lib/optparse.rb
# - on_tail(*params, &block)
# -->
# Creates an option from the given parameters `params`. See [Parameters for New
- # Options](./option_params.rdoc).
+ # Options](optparse/option_params.rdoc).
#
# The block, if given, is the handler for the created option. When the option is
# encountered during command-line parsing, the block is called with the argument
# given for the option, if any. See [Option
- # Handlers](./option_params.rdoc#label-Option+Handlers).
+ # Handlers](optparse/option_params.rdoc#label-Option+Handlers).
#
# The new option is added at the tail of the summary.
#
def on_tail: (*String params) ?{ (*untyped) -> untyped } -> self
| (String params, Class | Array[String] | Hash[Symbol, untyped] | Regexp obj, ?String desc) ?{ (*untyped) -> untyped } -> self
@@ -1658,19 +1661,19 @@
#
def parse: (untyped arg, untyped argv) { (*untyped) -> untyped } -> untyped
end
# <!-- rdoc-file=lib/optparse.rb -->
-# Switch that takes an argument, which does not begin with '-'.
+# Switch that takes an argument, which does not begin with '-' or is '-'.
#
class OptionParser::Switch::PlacedArgument < OptionParser::Switch
public
# <!--
# rdoc-file=lib/optparse.rb
# - parse(arg, argv, &error)
# -->
- # Returns nil if argument is not present or begins with '-'.
+ # Returns nil if argument is not present or begins with '-' and is not '-'.
#
def parse: (untyped arg, untyped argv) { (*untyped) -> untyped } -> untyped
end
# <!-- rdoc-file=lib/optparse.rb -->