From 7da3f8dcd34a58ce806cf2d8b22edb3261dea131 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 23 Feb 2024 21:49:57 +0900 Subject: [PATCH] [ruby/optparse] [DOC] About return value of OptionParser#new https://github.com/ruby/optparse/commit/59b9fd7ddc --- lib/optparse.rb | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/optparse.rb b/lib/optparse.rb index 08abca220f..51dbfd0ad2 100644 --- a/lib/optparse.rb +++ b/lib/optparse.rb @@ -1216,9 +1216,9 @@ XXX # # Directs to reject specified class argument. # - # +t+:: Argument class specifier, any object including Class. + # +type+:: Argument class specifier, any object including Class. # - # reject(t) + # reject(type) # def reject(*args, &blk) top.reject(*args, &blk) end # @@ -1347,6 +1347,9 @@ XXX # # Pushes a new List. # + # If a block is given, yields +self+ and returns the result of the + # block, otherwise returns +self+. + # def new @stack.push(List.new) if block_given? @@ -1570,6 +1573,12 @@ XXX nolong end + # ---- + # Option definition phase methods + # + # These methods are used to define options, or to construct an + # OptionParser instance in other words. + # :call-seq: # define(*params, &block) # @@ -1645,6 +1654,13 @@ XXX top.append(string, nil, nil) end + # ---- + # Arguments parse phase methods + # + # These methods parse +argv+, convert, and store the results by + # calling handlers. As these methods do not modify +self+, +self+ + # can be frozen. + # # Parses command line arguments +argv+ in order. When a block is given, # each non-option argument is yielded. When optional +into+ keyword