home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ruby164.zip / rbemx164.zip / ruby / share / doc / optparse-0.8.2 / optparse.ja.rd < prev    next >
Text File  |  2001-06-18  |  23KB  |  724 lines

  1. $Copyleft: (c) 2001 Nobuyoshi Nakada <nobu.nokada@softhome.net> $
  2. $Id: optparse.ja.rd,v 0.3 2001/04/13 06:43:30 nobu Exp $
  3.  
  4. =begin
  5. = ═╫╠≤
  6. Ñ│Ñ▐Ñ≤Ñ╔ÑΘÑñÑ≤ѬÑ╫Ñ╖ÑτÑ≤▓≥└╧═╤ÑΘÑñÑ╓ÑΘÑΩíú
  7.  
  8. Ñ╡Ñ▌í╝Ñ╚ñ╖ñ╞ñññδ╡í╟╜:
  9. (1) ├╗ññ╖┴╝░ñ╚─╣ññ╖┴╝░ñ╬ѬÑ╫Ñ╖ÑτÑ≤Ñ╣ÑñÑ├Ñ┴ñ≥║«║▀▓─╟╜íú
  10.     ├╗╖┴╝░ñ╬Ñ╣ÑñÑ├Ñ┴ñ╧░∞ñ─ñ╦ñ▐ñ╚ñßñδñ│ñ╚ñΓ▓─╟╜íú
  11. (2) Ñ╣ÑñÑ├Ñ┴ñ╬╗╪─Ωñ╚Ñ╧Ñ≤Ñ╔ÑΘñ≥ñ╜ñ∞ñ╛ñ∞░∞▓╒╜Ωñ╦ñ▐ñ╚ñßñ╞╜±ñ▒ñδíú
  12. (3) Ñ╣ÑñÑ├Ñ┴ñ╬░·┐⌠ñ╧╝½╞░┼¬ñ╦╗╪─Ωñ╖ñ┐Ñ»ÑΘÑ╣ñ╦╩╤┤╣ñ╡ñ∞ñδíú
  13. (4) Ñ¬Ñ╫Ñ╖ÑτÑ≤Ñ╡Ñ▐ÑΩñ≥║εñ∞ñδíú
  14. (5) ╕σñ½ñΘíóñóñδñññ╧┼╙├µñ╟ѬÑ╫Ñ╖ÑτÑ≤ñ≥─╔▓├ñ╟ñ¡ñδíú
  15. =end #'#"#`#
  16.  
  17. =begin
  18. = │╡═╫
  19.  
  20. == Ñ»ÑΘÑ╣╣╜└«
  21.    * ((<OptionParser>)) Ñ╒ÑφÑ≤Ñ╚Ñ¿Ñ≤Ñ╔
  22.    * ((<OptionParser::Switch>)) ñ╜ñ∞ñ╛ñ∞ñ╬Ñ╣ÑñÑ├Ñ┴
  23.    * ((<OptionParser::List>)) Ñ¬Ñ╫Ñ╖ÑτÑ≤ÑΩÑ╣Ñ╚
  24.    * ((<OptionParser::ParseError>)) Ñ¬Ñ╫Ñ╖ÑτÑ≤▓≥└╧╗■ñ╬Ñ¿ÑΘí╝
  25.      * ((<OptionParser::AmbiguousOption>))
  26.      * ((<OptionParser::NeedlessArgument>))
  27.      * ((<OptionParser::MissingArgument>))
  28.      * ((<OptionParser::InvalidOption>))
  29.      * ((<OptionParser::InvalidArgument>))
  30.        * ((<OptionParser::AmbiguousArgument>))
  31.  
  32. == Ñ¬Ñ╓Ñ╕ѺѻÑ╚┤╪╧ó┐▐
  33.    +--------------+
  34.    | OptionParser |<>-----+
  35.    +--------------+       |                     +--------+
  36.                           |                   ,-| Switch |
  37.         on_head -------->+-------------+    /  +--------+
  38.         accept/reject -->| List        |<|>-
  39.                          |             |<|>-  +----------+
  40.         on ------------->+-------------+    `-| argument |
  41.                          :             :      |  class   |
  42.                          +-------------+      |==========|
  43.         on_tail -------->|             |      |pattern   |
  44.                          +-------------+      |----------|
  45.    OptionParser.accept ->| DefaultList |      |converter |
  46.                 reject   |(┴┤ÑñÑ≤Ñ╣Ñ┐Ñ≤|      +----------+
  47.                          | Ñ╣ñ╟╢ª═¡)   |
  48.                          +-------------+
  49.  
  50. =end #'#"#`#
  51.  
  52. =begin
  53. = Ñ»ÑΘÑ╣ & ÑΓÑ╕Ñσí╝Ñδ
  54. =end #'#"#`#
  55. =begin private
  56. == ((:OptionParser::Completion:))
  57. Ñ¡í╝Ñ∩í╝Ñ╔ñ╬╩Σ┤░ñ≥ñ╣ñδÑΓÑ╕Ñσí╝Ñδ
  58. =end #'#"#`#
  59. =begin private
  60. --- OptionParser::Completion#complete(key[, pat])
  61.     ((|key|))ñ≥├╡ñ╣íú╕½╔╒ñ½ñΘñ╩ññ╛∞╣τñ╧((|pat|))ñ╟╩Σ┤░ñ╖ñ╞├╡ñ╣íú
  62.     :Parameters:
  63.       : ((|key|))
  64.         ╕í║≈ñ╣ñδÑ¡í╝Ñ∩í╝Ñ╔
  65.       : ((|pat|))
  66.         ╩Σ┤░ñ╣ñδÑ╤Ñ┐í╝Ñ≤
  67. =end #'#"#`#
  68. =begin private
  69. --- OptionParser::Completion#convert(opt, *val)
  70.     ((<OptionParser::Completion#complete>))ñ╟╕í║≈ñ╖ñ┐╖δ▓╠ñ½ñΘ║╟╜Θñ╬ñΓñ╬ñ≥╝ΦñΩ╜╨ñ╣íú
  71. =end #'#"#`#
  72. =begin private
  73. == ((:OptionParser::Filling:))
  74. (({Array#fill}))ñ╬ñΦñªñ╩ÑßÑ╜Ñ├Ñ╔(({fill}))ñ≥─╔▓├ñ╣ñδíú
  75. =end #'#"#`#
  76. =begin private
  77. == ((:OptionParser::OptionMap:))
  78. ѬÑ╫Ñ╖ÑτÑ≤í┐Ñ¡í╝Ñ∩í╝Ñ╔╩╕╗·╬≤ñ½ñΘѬÑ╓Ñ╕ѺѻÑ╚ñ╪ñ╬Ñ▐Ñ├Ñ╫(╩Σ┤░╡í╟╜╔╒ñ¡)íú
  79. === Ñ╣í╝Ñ╤í╝Ñ»ÑΘÑ╣
  80. (({Hash}))
  81. === ÑñÑ≤Ñ»Ñδí╝Ñ╔ÑΓÑ╕Ñσí╝Ñδ
  82. ((<OptionParser::Completion>)), ((<OptionParser::Filling>))
  83. =end #'#"#`#
  84. =begin
  85. == ((:OptionParser::Switch:))
  86. │╞Ñ╣ÑñÑ├Ñ┴ñ╬Ñ»ÑΘÑ╣íú
  87. =end #'#"#`#
  88. =begin private
  89. === Ñ»ÑΘÑ╣ÑßÑ╜Ñ├Ñ╔
  90. =end
  91. =begin private
  92. --- OptionParser::Switch.guess(arg)
  93.     ((|arg|))ñ½ñΘ░·┐⌠ñ╬Ñ╣Ñ┐ÑñÑδñ≥╚╜├╟ñ╣ñδíú
  94.     │║┼÷ñ╣ñδ((<OptionParser::Switch>))ñ╬Ñ╡Ñ╓Ñ»ÑΘÑ╣ñ≥╩╓ñ╣íú
  95. =end #'#"#`#
  96. =begin private
  97. --- OptionParser::Switch.new
  98. =end #'#"#`#
  99. =begin
  100. === ÑñÑ≤Ñ╣Ñ┐Ñ≤Ñ╣ÑßÑ╜Ñ├Ñ╔
  101. =end
  102. =begin private
  103. --- OptionParser::Switch#parse_arg(arg) {non-serious error handler}
  104.     Ñ╣ÑñÑ├Ñ┴ñ╦┬╨ñ╣ñδ░·┐⌠ñ≥Ñ╤í╝Ñ╣ñ╖ñ╞íó░·┐⌠ñ╚ñ▀ñ╩ñ╣╔⌠╩¼ñ╚╗─ñΩñ╬╔⌠╩¼ñ╦╩¼│Σ
  105.     ñ╖ñ╞╩╓ñ╣íú
  106.     :Parameters:
  107.       : ((|arg|))
  108.         Ñ╤í╝Ñ╣ñ╣ñδÑ╣ÑñÑ├Ñ┴ñ╦┬╨ñ╣ñδ░·┐⌠íú
  109.       : (({block}))
  110.         Ñ╤Ñ┐í╝Ñ≤ñ╦░·┐⌠ñ¼Ñ▐Ñ├Ñ┴ñ╖ñ╩ñññ╚ñ¡ñ╦╕╞ñ╨ñ∞ñδíú
  111. =end #'#"#`#
  112. =begin
  113. --- OptionParser::Switch#parse(arg, val) {semi-error handler}
  114.     ░·┐⌠ñ≥Ñ╤í╝Ñ╣íó╩╤┤╣ñ╖ñ╞((|arg|))íó((|block|))íó╩╤┤╣╖δ▓╠ñ≥╩╓ñ╣íú
  115.     : ((|@conv|))ñ╪ñ╬░·┐⌠:
  116.       ((|@pattern|))ñ╦Ñ▐Ñ├Ñ┴ñ╖ñ┐╔⌠╩¼╩╕╗·╬≤ñ╬ÑΩÑ╣Ñ╚íó
  117.       ((|$&|)), ((|$1|)), ((|$2|)) ñ╩ñ╔íú
  118.     :Parameters:
  119.       : ((|arg|))
  120.         Ñ╣ÑñÑ├Ñ┴ñ╦─╛ñ╦╗╪─Ωñ╡ñ∞ñ╞ñññ┐░·┐⌠ñ╬╩╕╗·╬≤íú
  121.       : ((|val|))
  122.         Ñ╣ÑñÑ├Ñ┴░╩╣▀ñ╬░·┐⌠íú
  123.       : (({block}))
  124.         Ñ¿ÑΘí╝ñ½ñΓ├╬ñ∞ñ╩ñññ╚ñ¡ñ╦╬π│░ñ≥(({yield}))ñ╣ñδíú
  125. =end #'#"#`#
  126. =begin
  127. --- OptionParser::Switch#summarize(sdone, ldone, width, max, indent)
  128.     Ñ¬Ñ╫Ñ╖ÑτÑ≤Ñ╡Ñ▐ÑΩñ≥║εñδíú
  129.     :Parameters:
  130.       : ((|sdone|))
  131.         ñ╣ñ╟ñ╦Ñ╡Ñ▐ÑΩñ╦╞■ñ├ñ╞ñññδ├╗╖┴╝░ѬÑ╫Ñ╖ÑτÑ≤ñ≥Ñ¡í╝ñ╚ñ╣ñδÑ╧Ñ├Ñ╖Ñσíú
  132.       : ((|ldone|))
  133.         ñ╣ñ╟ñ╦Ñ╡Ñ▐ÑΩñ╦╞■ñ├ñ╞ñññδ─╣╖┴╝░ѬÑ╫Ñ╖ÑτÑ≤ñ≥Ñ¡í╝ñ╚ñ╣ñδÑ╧Ñ├Ñ╖Ñσíú
  134.       : ((|width|))
  135.         ║╕┬ªñ╬ѬÑ╫Ñ╖ÑτÑ≤ÑΩÑ╣Ñ╚╔⌠╩¼ñ╬╔²íúѬÑ╫Ñ╖ÑτÑ≤ñ╬└Γ╠└ñ╧ñ╜ñ╬▒ª┬ªíó((|width|))╖σ╠▄ñ½ñΘ╗╧ñ▐ñδíú
  136.       : ((|max|))
  137.         ║╕┬ªñ╬║╟┬τ╔²íúѬÑ╫Ñ╖ÑτÑ≤ñ╧((|max|))╖σ░╩╞Γñ╦╡═ñßñΘñ∞ñδíú
  138.       : ((|indent|))
  139.         │╞╣╘ñ≥ÑñÑ≤Ñ╟Ñ≤Ñ╚ñ╣ñδñ┐ñßñ╬╩╕╗·╬≤íú
  140.       : (({block}))
  141.         │╞╣╘ñ┤ñ╚ñ╦┼╧ñ╡ñ∞ñδ(▓■╣╘ñ╧╔╒ñ½ñ╩ññ)íú
  142. =end #'#"#`#
  143. =begin
  144. --- OptionParser::Switch#-@
  145.     ╚┐┼╛ñ╖ñ┐Ñ╓í╝ÑΩÑóÑ≤Ñ╣ÑñÑ├Ñ┴(((|@block|))ñ╦┼╧ñ╡ñ∞ñδ░·┐⌠ñ¼╚┐┼╛ñ╡
  146.     ñ∞ñδ)ñ≥║εñδ
  147. =end #'#"#`#
  148. =begin private
  149. == Ñ╣ÑñÑ├Ñ┴ñ╬╝∩╬α
  150. =end #'#"#`#
  151. =begin private
  152. === ((:OptionParser::Switch::NoArgument:))
  153. ░·┐⌠ñ≥ñ╚ñΘñ╩ññÑ╣ÑñÑ├Ñ┴íú
  154. ==== Ñ╣í╝Ñ╤í╝Ñ»ÑΘÑ╣
  155. ((<OptionParser::Switch>))
  156. ==== ÑñÑ≤Ñ╣Ñ┐Ñ≤Ñ╣ÑßÑ╜Ñ├Ñ╔
  157. --- OptionParser::Switch::NoArgument#parse
  158.     ░·┐⌠ñ¼ñóñδñ╚╬π│░ñ≥╚»└╕íú
  159. =end #'#"#`#
  160. =begin private
  161. === ((:OptionParser::Switch::RequiredArgument:))
  162. ░·┐⌠ñ≥ñ╚ñδÑ╣ÑñÑ├Ñ┴íú
  163. ==== Ñ╣í╝Ñ╤í╝Ñ»ÑΘÑ╣
  164. ((<OptionParser::Switch>))
  165. ==== ÑñÑ≤Ñ╣Ñ┐Ñ≤Ñ╣ÑßÑ╜Ñ├Ñ╔
  166. --- OptionParser::Switch::RequiredArgument#parse
  167.     ░·┐⌠ñ¼ñ╩ñññ╚╬π│░ñ≥╚»└╕íú
  168. =end #'#"#`#
  169. =begin private
  170. === ((:OptionParser::Switch::OptionalArgument:))
  171. ░·┐⌠ñ≥╛╩╬¼ñ╟ñ¡ñδÑ╣ÑñÑ├Ñ┴íú
  172. ==== Ñ╣í╝Ñ╤í╝Ñ»ÑΘÑ╣
  173. ((<OptionParser::Switch>))
  174. ==== ÑñÑ≤Ñ╣Ñ┐Ñ≤Ñ╣ÑßÑ╜Ñ├Ñ╔
  175. --- OptionParser::Switch::OptionalArgument#parse
  176.     ░·┐⌠ñ¼ñóñ∞ñ╨ñ╜ñ∞ñ≥▓≥└╧íóñ╩ñ▒ñ∞ñ╨Ñ╟Ñ╒Ñ⌐ÑδÑ╚├═ñ≥╗╚═╤íú
  177. =end #'#"#`#
  178. =begin
  179. == ((:OptionParser::List:))
  180. ├▒░∞ñ╬ѬÑ╫Ñ╖ÑτÑ≤ÑΩÑ╣Ñ╚íó├╗í┐─╣╖┴╝░ñ╬ѬÑ╫Ñ╖ÑτÑ≤╩╕╗·╬≤ñ½ñΘÑ╣ÑñÑ├Ñ┴ñ╪ñ╬Ñ▐Ñ├
  181. Ñ╘Ñ≤Ñ░íó╝⌡ñ▒╔╒ñ▒ñΘñ∞ñδ░·┐⌠Ñ┐ÑñÑ╫ñ½ñΘÑ╤Ñ┐í╝Ñ≤ñ╚Ñ│Ñ≤Ñ╨í╝Ñ┐ñ╪ñ╬Ñ▐Ñ├Ñ╘Ñ≤Ñ░ñ≥
  182. ─≤╢íñ╣ñδíúÑ╡Ñ▐ÑΩñΓñ│ñ│ñ╟─≤╢íñ╡ñ∞ñδíú
  183. =end #'#"#`#
  184. =begin
  185. === Ñ»ÑΘÑ╣ÑßÑ╜Ñ├Ñ╔
  186. =end #'#"#`#
  187. =begin private
  188. --- OptionParser::List.new
  189.     ÑñÑ≤Ñ╣Ñ┐Ñ≤Ñ╣ñ╬╜Θ┤ⁿ▓╜íú
  190. =end #'#"#`#
  191. =begin
  192. === ÑñÑ≤Ñ╣Ñ┐Ñ≤Ñ╣ÑßÑ╜Ñ├Ñ╔
  193. =end #'#"#`#
  194. =begin
  195. --- OptionParser::List#atype
  196.     ░·┐⌠Ñ┐ÑñÑ╫ñ½ñΘÑ╤Ñ┐í╝Ñ≤í┐Ñ│Ñ≤Ñ╨í╝Ñ┐ñ╬Ñ┌Ñóñ╪ñ╬Ñ▐Ñ├Ñ╫íú
  197. --- OptionParser::List#short
  198.     ├╗╖┴╝░ñ╬ѬÑ╫Ñ╖ÑτÑ≤Ñ╣ÑñÑ├Ñ┴ñ½ñΘÑ╣ÑñÑ├Ñ┴ѬÑ╓Ñ╕ѺѻÑ╚ñ╪ñ╬Ñ▐Ñ├Ñ╫íú
  199. --- OptionParser::List#long
  200.     ─╣╖┴╝░ñ╬ѬÑ╫Ñ╖ÑτÑ≤Ñ╣ÑñÑ├Ñ┴ñ½ñΘÑ╣ÑñÑ├Ñ┴ѬÑ╓Ñ╕ѺѻÑ╚ñ╪ñ╬Ñ▐Ñ├Ñ╫íú
  201. --- OptionParser::List#list
  202.     ┴┤Ñ╣ÑñÑ├Ñ┴ñ╚Ñ╡Ñ▐ÑΩ╩╕╗·╬≤ñ╬ÑΩÑ╣Ñ╚íú
  203. =end #'#"#`#
  204. =begin private
  205. --- OptionParser::List#accept(type[, pattern]) {...}
  206.     ((<OptionParser.accept>))╗▓╛╚íú
  207. --- OptionParser::List#reject(type)
  208.     ((<OptionParser.reject>))╗▓╛╚íú
  209. =end #'#"#`#
  210. =begin private
  211. --- OptionParser::List#update(sw, sopts, lopts, nlopts = [])
  212.     ((|sw|))ñ≥((|sopts|))íó((|lopts|))íó((|nlopts|))ñ╦ñ╖ñ┐ñ¼ñ├ñ╞─╔▓├ñ╣ñδíú
  213.     :Parameters:
  214.       : ((|sw|))
  215.         ─╔▓├ñ╣ñδ((<OptionParser::Switch>))ÑñÑ≤Ñ╣Ñ┐Ñ≤Ñ╣íú
  216.       : ((|sopts|))
  217.         ((|sw|))ñ╦┬╨▒■ñ╣ñδ├╗╖┴╝░ѬÑ╫Ñ╖ÑτÑ≤ñ╬ÑΩÑ╣Ñ╚íú
  218.       : ((|lopts|))
  219.         ((|sw|))ñ╦┬╨▒■ñ╣ñδ─╣╖┴╝░ѬÑ╫Ñ╖ÑτÑ≤ñ╬ÑΩÑ╣Ñ╚íú
  220.       : ((|nlopts|))
  221.         ╚▌─Ω╖┴╝░ñ╬─╣╖┴╝░ѬÑ╫Ñ╖ÑτÑ≤ñ╬ÑΩÑ╣Ñ╚íú
  222. =end #'#"#`#
  223. =begin
  224. --- OptionParser::List#prepend(switch, short_opts, long_opts, nolong_opts)
  225.     ((|switch|))ñ≥ÑΩÑ╣Ñ╚ñ╬╞¼ñ╦┴▐╞■ñ╖ñ╞íó├╗í┐─╣í┐╚▌─Ω╖┴╝░ñ╬ѬÑ╫Ñ╖ÑτÑ≤ñ╦┬╨▒■ñ╡ñ╗ñδíú
  226. --- OptionParser::List#append(switch, short_opts, long_opts, nolong_opts)
  227.     ((|switch|))ñ≥ÑΩÑ╣Ñ╚ñ╬║╟╕σñ╦─╔▓├ñ╖ñ╞íó├╗í┐─╣í┐╚▌─Ω╖┴╝░ñ╬ѬÑ╫Ñ╖ÑτÑ≤ñ╦┬╨▒■ñ╡ñ╗ñδíú
  228.     :Parameters:
  229.       : ((|switch|))
  230.         ┴▐╞■ñ╣ñδ((<OptionParser::Switch>))ÑñÑ≤Ñ╣Ñ┐Ñ≤Ñ╣íú
  231.       : ((|short_opts|))
  232.         ((|switch|))ñ╦┬╨▒■ñ╣ñδ├╗╖┴╝░ѬÑ╫Ñ╖ÑτÑ≤ñ╬ÑΩÑ╣Ñ╚íú
  233.       : ((|long_opts|))
  234.         ((|switch|))ñ╦┬╨▒■ñ╣ñδ─╣╖┴╝░ѬÑ╫Ñ╖ÑτÑ≤ñ╬ÑΩÑ╣Ñ╚íú
  235.       : ((|nolong_opts|))
  236.         (({"no-"}))ñ╬ñ─ñ»╚▌─Ω╖┴╝░ñ╬ѬÑ╫Ñ╖ÑτÑ≤ñ╬ÑΩÑ╣Ñ╚íú
  237. =end #'#"#`#
  238. =begin
  239. --- OptionParser::List#search(id, key) [{block}]
  240.     ((|key|))ñ≥((|id|))ñ╬ÑΩÑ╣Ñ╚ñ½ñΘ╕í║≈ñ╣ñδíú
  241.     :Parameters:
  242.       : ((|id|))
  243.         ╕í║≈ñ╣ñδÑΩÑ╣Ñ╚íú
  244.       : ((|k|))
  245.         ╕í║≈ñ╣ñδÑ¡í╝íú
  246.       : (({Block}))
  247.         ╕½╔╒ñ½ñ├ñ┐ñ╚ñ¡ñ╦ñ╜ñ╬├═ñ╟╕╞ñ╙╜╨ñ╡ñ∞ñδíú
  248. =end #'#"#`#
  249. =begin
  250. --- OptionParser::List#complete(id, opt, *pat, &block)
  251.     ((|opt|))ñ≥((|id|))ñ╬ÑΩÑ╣Ñ╚ñ½ñΘ((|*pat|))ñ╟╩Σ┤░ñ╖ñ╞╕í║≈ñ╣ñδíú
  252.     :Parameters:
  253.       : ((|id|))
  254.         ╕í║≈ñ╣ñδÑΩÑ╣Ñ╚íú
  255.       : ((|opt|))
  256.         ╕í║≈ñ╣ñδÑ¡í╝íú
  257.       : ((|*pat|))
  258.         ╩Σ┤░ñ╦╗╚ñªÑ╤Ñ┐í╝Ñ≤íú
  259.       : (({Block}))
  260.         ╕½╔╒ñ½ñ├ñ┐ñ╚ñ¡ñ╦ñ╜ñ╬├═ñ╟╕╞ñ╙╜╨ñ╡ñ∞ñδíú
  261. =end #'#"#`#
  262. =begin
  263. --- OptionParser::List#summarize(*args) {...}
  264.     Ñ╡Ñ▐ÑΩÑ╞í╝Ñ╓Ñδñ≥║εñδíú░∞╣╘ñ┤ñ╚ñ╦(({block}))ñ≥╕╞ñ╙╜╨ñ╣íú
  265.     (({@list}))ñ╬═╫┴╟ñ╧(({summarize}))ñ╟ñ¡ñδ╔¼═╫ñ¼ñóñδíú
  266.     :Parameters:
  267.       : ((|args|))
  268.         ñ╜ñ╬ñ▐ñ▐│╞═╫┴╟ñ╬ summarize ñ╦┼╧ñ╡ñ∞ñδíú
  269.       : (({block}))
  270.         │╞╣╘ñ┤ñ╚ñ╦┼╧ñ╡ñ∞ñδ(▓■╣╘ñ╧╔╒ñ½ñ╩ññ)íú
  271. =end #'#"#`#
  272. =begin private
  273. == ((:OptionParser::CompletingHash:))
  274. ╩Σ┤░╕í║≈╡í╟╜╔╒ñ¡ñ╬(({Hash}))íú
  275. === Ñ╣í╝Ñ╤í╝Ñ»ÑΘÑ╣
  276. (({Hash}))
  277. === ÑñÑ≤Ñ»Ñδí╝Ñ╔ÑΓÑ╕Ñσí╝Ñδ
  278. ((<OptionParser::Completion>))
  279. =end #'#"#`#
  280. =begin private
  281. === ÑñÑ≤Ñ╣Ñ┐Ñ≤Ñ╣ÑßÑ╜Ñ├Ñ╔
  282. --- OptionParser::CompletingHash#match(key)
  283.     Ñ╧Ñ├Ñ╖ÑσÑ¡í╝ñ≥╩Σ┤░ñ╖ñ╞╕í║≈ñ╣ñδíú
  284. =end #'#"#`#
  285. =begin
  286. == ((:OptionParser:))
  287. ѬÑ╫Ñ╖ÑτÑ≤Ñ╤í╝Ñ╡ñ╬Ñ╒ÑφÑ≤Ñ╚Ñ¿Ñ≤Ñ╔íú
  288. =end #'#"#`#
  289. =begin
  290. === ─Ω┐⌠
  291. =end #'#"#`#
  292. =begin
  293. --- OptionParser::ArgumentStyle
  294.     ╝ΦñΩñªñδ░·┐⌠ñ╬Ñ╣Ñ┐ÑñÑδñ╬╝∩╬αíú├═ñ╧ñ╜ñ∞ñ╛ñ∞:
  295.     : (({OptionParser::NO_ARGUMENT}))
  296.       ░·┐⌠ñ≥╝ΦñΘñ╩ññÑ╣ÑñÑ├Ñ┴íú
  297.     : (({OptionParser::REQUIRED_ARGUMENT}))
  298.       ░·┐⌠ñ¼╔¼┐▄ñ╬Ñ╣ÑñÑ├Ñ┴íú─╛╕σñ╦░·┐⌠ñ¼(({=}))ñ╟╗╪─Ωñ╡ñ∞ñ╞ñññ╩ñ▒ñ∞ñ╨íó╝íñ╬╩╕╗·╬≤ñ≥░·┐⌠ñ╚ñ▀ñ╩ñ╣íú
  299.       ╢⌡ñ╬░·┐⌠ñ≥╗╪─Ωñ╣ñδñ╚ñ¡ñ╧íó(({=}))ñ└ñ▒ñ≥ñ─ñ▒ñδíú
  300.     : (({OptionParser::OPTIONAL_ARGUMENT}))
  301.       Ñ¬Ñ╫Ñ╖ÑτÑ╩Ñδñ╩░·┐⌠ñ≥╝ΦñδÑ╣ÑñÑ├Ñ┴íúñ─ñ▐ñΩ░·┐⌠ñ≥╔╒ñ▒ñ╞ñΓ╔╒ñ▒ñ╩ñ»ñ╞ñΓñΦññíú
  302.  
  303.     ░·┐⌠ñ≥╗╪─Ωñ╣ñδñ╚ñ¡ñ╧(({--switch=argument}))(─╣╖┴╝░)ñ½íó
  304.     (({-Xargument}))(├╗╖┴╝░)ñ╚ñ╣ñδíú├╗╖┴╝░ñ╟ñ╧íó((<░·┐⌠Ñ╤Ñ┐í╝Ñ≤>))ñ╦Ñ▐Ñ├
  305.     Ñ┴ñ╣ñδ╔⌠╩¼ñ└ñ▒ñ¼░·┐⌠ñ╚ñ╖ñ╞╟º╝▒ñ╡ñ∞ñδíú
  306. =end #'#"#`#
  307. =begin
  308. --- OptionParser::DefaultList
  309.     '--'ñ╬ñΦñªñ╦┴┤OptionParserÑñÑ≤Ñ╣Ñ┐Ñ≤Ñ╣ñ╟╢ª═¡ñ╣ñδÑ╣ÑñÑ├Ñ┴ñΣíóÑ╟Ñ╒Ñ⌐Ñδ
  310.     Ñ╚ñ╬░·┐⌠Ñ»ÑΘÑ╣ñ≥╗²ñ─íú
  311. =end #'#"#`#
  312. =begin undocumented
  313. === Ñ╟Ñ╒Ñ⌐ÑδÑ╚ѬÑ╫Ñ╖ÑτÑ≤
  314. Ñ╒Ñ⌐ÑδÑ╚ñ╟╟º╝▒ñ╡ñ∞ñδñ¼íóѬÑ╫Ñ╖ÑτÑ≤Ñ╡Ñ▐ÑΩñ╦ñ╧╕╜ñ∞ñ╩ññѬÑ╫Ñ╖ÑτÑ≤íú
  315. --- --help
  316.     Ñ¬Ñ╫Ñ╖ÑτÑ≤Ñ╡Ñ▐ÑΩñ≥╔╜╝¿ñ╣ñδíú
  317. --- --version
  318.     (({::Version})) ñ¼─Ω╡┴ñ╡ñ∞ñ╞ñññ∞ñ╨Ñ╨í╝Ñ╕ÑτÑ≤╛≡╩≤ñ≥╔╜╝¿ñ╣ñδíú
  319. =end #'#"#`#
  320. =begin
  321. === Ñ»ÑΘÑ╣ÑßÑ╜Ñ├Ñ╔
  322. =end #'#"#`#
  323. =begin
  324. --- OptionParser.with([banner[, width[, indent]]]) [{...}]
  325.     ┐╖ñ╖ññÑñÑ≤Ñ╣Ñ┐Ñ≤Ñ╣ñ≥║ε└«ñ╖ñ╞íóÑñÑ╞Ñ∞í╝Ñ┐ñ╚ñ╖ñ╞╕╞ñ╨ñ∞ñ╞ñññδñ╚ñ¡ñ╦
  326.     ñ╧Ñ╓ÑφÑ├Ñ»ñ≥ñ╜ñ╬ÑñÑ≤Ñ╣Ñ┐Ñ≤Ñ╣ñ╬Ñ│Ñ≤Ñ╞Ñ»Ñ╣Ñ╚ñ╟╔╛▓┴ñ╖ñ╞ñ½ñΘíó╩╓ñ╣íú
  327.     ñ│ñ╬╞░║εñ╧░╩┴░ñ╬(({new}))ñ╚╞▒ñ╕ñ└ñ¼íó((*depricated*))ñ╩ÑßÑ╜Ñ├Ñ╔íú
  328.  
  329.     cf. ((<OptionParser#initialize>))
  330.     :Parameters:
  331.       : ((|banner|))
  332.         Ñ╨Ñ╩í╝ÑßÑ├Ñ╗í╝Ñ╕íú
  333.       : ((|width|))
  334.         Ñ╡Ñ▐ÑΩñ╬╔²íú
  335.       : ((|indent|))
  336.         Ñ╡Ñ▐ÑΩñ╬ÑñÑ≤Ñ╟Ñ≤Ñ╚╩╕╗·╬≤íú
  337.       : (({Block}))
  338.         ║ε└«ñ╖ñ┐ÑñÑ≤Ñ╣Ñ┐Ñ≤Ñ╣ñ╬Ñ│Ñ≤Ñ╞Ñ»Ñ╣Ñ╚ñ╟╔╛▓┴ñ╡ñ∞ñδíú
  339. =end #'#"#`#
  340. =begin
  341. --- OptionParser.new([banner[, width[, indent]]]) [{...}]
  342.     ÑñÑ≤Ñ╣Ñ┐Ñ≤Ñ╣ñ≥╜Θ┤ⁿ▓╜ñ╣ñδíúÑñÑ╞Ñ∞í╝Ñ┐ñ╚ñ╖ñ╞╕╞ñ╨ñ∞ñ╞ñññδ╛∞╣τñ╧íó╝½╩¼╝½
  343.     ┐╚ñ≥┼╧ñ╣íú
  344.     :Parameters:
  345.       : ((|banner|))
  346.         Ñ╨Ñ╩í╝ÑßÑ├Ñ╗í╝Ñ╕íúÑ╟Ñ╒Ñ⌐ÑδÑ╚ñ╧(({nil}))íú
  347.       : ((|width|))
  348.         Ñ╡Ñ▐ÑΩñ╬╔²íúÑ╟Ñ╒Ñ⌐ÑδÑ╚ñ╧32
  349.       : ((|indent|))
  350.         Ñ╡Ñ▐ÑΩñ╬ÑñÑ≤Ñ╟Ñ≤Ñ╚íúÑ╟Ñ╒Ñ⌐ÑδÑ╚ñ╧╢⌡╟≥4╕─íú
  351.       : (({Block}))
  352.         ((|self|))ñ¼┼╧ñ╡ñ∞ñδíú
  353. =end #'#"#`#
  354. =begin
  355. --- OptionParser.terminate([arg])
  356.     Ñ¬Ñ╫Ñ╖ÑτÑ≤ñ╬▓≥└╧ñ≥╜¬╬╗ñ╡ñ╗ñδíú╛╩╬¼▓─╟╜ñ╩((|arg|))ñ¼═┐ñ¿ñΘñ∞ñ╞ñññδñ╚íó
  357.     Ñ│Ñ▐Ñ≤Ñ╔ÑΘÑñÑ≤░·┐⌠ñ╦╠ßñ╡ñ∞ñδíú
  358.     :Parameters:
  359.       : ((|arg|))
  360.         ║╟╜Θñ╬ѬÑ╫Ñ╖ÑτÑ≤ñ╟ñ╩ññ░·┐⌠ñ╚ñ╖ñ╞╠ßñ╡ñ∞ñδ╩╕╗·╬≤íú
  361. =end #'#"#`#
  362. =begin
  363. --- OptionParser.accept(t, [pat]) {...}
  364. --- OptionParser#accept(t, [pat]) {...}
  365.     ╗╪─Ωñ╖ñ┐Ñ»ÑΘÑ╣ñ╬ѬÑ╫Ñ╖ÑτÑ≤░·┐⌠ñ≥╝⌡ñ▒╔╒ñ▒ñΘñ∞ñδñΦñªñ╦ñ╣ñδíú
  366.     :Parameters:
  367.       : ((|t|))
  368.         ░·┐⌠Ñ»ÑΘÑ╣ñ≥╗╪─Ωñ╣ñδѬÑ╓Ñ╕ѺѻÑ╚íó─╠╛∩ñ╧(({Class}))íú
  369.       : ((|pat|))
  370.         ░·┐⌠ñ╬Ñ╤Ñ┐í╝Ñ≤íú((|t|))ñ¼(({match}))ñ≥╗²ñ├ñ╞ñññ∞ñ╨ñ╜ñ∞ñ¼Ñ╟Ñ╒Ñ⌐ÑδÑ╚íú
  371.       : (({Block}))
  372.         ░·┐⌠ñ╬╩╕╗·╬≤ñ≥╝⌡ñ▒╝Φñ├ñ╞═╫╡ßñ╡ñ∞ñδÑ»ÑΘÑ╣ñ╦╩╤┤╣ñ╣ñδíú
  373. =end #'#"#`#
  374. =begin
  375. --- OptionParser.reject(t)
  376. --- OptionParser#reject(t)
  377.     ╗╪─Ωñ╖ñ┐Ñ»ÑΘÑ╣ñ╬ѬÑ╫Ñ╖ÑτÑ≤░·┐⌠ñ≥╝⌡ñ▒╔╒ñ▒ñ╩ñññΦñªñ╦ñ╣ñδíú
  378.     :Parameters:
  379.       : ((|t|))
  380.         ░·┐⌠Ñ»ÑΘÑ╣ñ≥╗╪─Ωñ╣ñδѬÑ╓Ñ╕ѺѻÑ╚íú
  381. =end #'#"#`#
  382. =begin private
  383. --- OptionParser.yieldproc(*args) {block}
  384.     (({Proc}))ñΣ(({Method}))ñ≥ÑñÑ╞Ñ∞í╝Ñ┐Ñ╓ÑφÑ├Ñ»ñ╚ñ╖ñ╞((|args|))ñ≥░·┐⌠ñ╦ñ╖ñ╞╕╞ñ╙╜╨ñ╣íú
  385.     :Parameters:
  386.       : ((|*args|))
  387.         (({Block}))ñ╪ñ╬░·┐⌠íú
  388.       : (({Block}))
  389.         ╕╞ñ╙╜╨ñ╣(({Proc}))ñ½(({Method}))íúÑ╓ÑφÑ├Ñ»ñ╚ñ╖ñ╞┼╧ñ╡ñ∞ñ╩ñ▒ñ∞ñ╨ñ╩ñΘñ╩ññíú
  390. =end #'#"#`#
  391. =begin
  392. === ÑñÑ≤Ñ╣Ñ┐Ñ≤Ñ╣ÑßÑ╜Ñ├Ñ╔
  393. =end #'#"#`#
  394. =begin
  395. --- OptionParser#banner
  396. --- OptionParser#banner=(heading)
  397.     Ñ╡Ñ▐ÑΩñ╬└Φ╞¼ñ╦╜╨╬╧ñ╡ñ∞ñδÑ╨Ñ╩í╝íú
  398. --- OptionParser#summary_width
  399. --- OptionParser#summary_width=(width)
  400.     Ñ╡Ñ▐ÑΩñ╬ѬÑ╫Ñ╖ÑτÑ≤ÑΩÑ╣Ñ╚╔⌠╩¼ñ╬╔²íú(({Numeric}))ñ╟ñóñδ═╫ñ¼ñóñδíú
  401. --- OptionParser#summary_indent
  402. --- OptionParser#summary_indent=(indent)
  403.     Ñ╡Ñ▐ÑΩñ╬ÑñÑ≤Ñ╟Ñ≤Ñ╚íú(({String}))ñ╟ñ╩ñ▒ñ∞ñ╨ñ╩ñΘñ╩ññ(ñΓñ╖ñ»ñ╧
  404.     (({String}))ñ≥(({+}))ñ╟ñ¡ñδÑΓÑ╬)íú
  405. --- OptionParser#program_name
  406. --- OptionParser#program_name=(name)
  407.     Ñ¿ÑΘí╝ÑßÑ├Ñ╗í╝Ñ╕ñΣÑ╟Ñ╒Ñ⌐ÑδÑ╚ñ╬Ñ╨Ñ╩í╝ñ╟╜╨╬╧ñ╡ñ∞ñδÑ╫ÑφÑ░ÑΘÑα╠╛íú
  408.     Ñ╟Ñ╒Ñ⌐ÑδÑ╚ñ╧(({$0}))íú
  409. =end #'#"#`#
  410. =begin
  411. --- OptionParser#top
  412.     ((<on>))/((<on_head>))íó((<accept>))/((<reject>))ñ╬┬╨╛▌íú
  413. =end #'#"#`#
  414. =begin
  415. --- OptionParser#base
  416.     ((<on_tail>))ñ╬┬╨╛▌íú
  417. =end #'#"#`#
  418. =begin
  419. --- OptionParser#new
  420.     ┐╖ñ╖ññ(({List}))ñ≥─╔▓├ñ╣ñδíú
  421. =end #'#"#`#
  422. =begin
  423. --- OptionParser#remove
  424.     ║╟╕σñ╬(({List}))ñ≥║∩╜ⁿñ╣ñδíú
  425. =end #'#"#`#
  426. =begin
  427. --- OptionParser#summarize(to = [], width = @summary_width, max = width - 1, indent = @summary_indent)
  428.     Ñ¬Ñ╫Ñ╖ÑτÑ≤Ñ╡Ñ▐ÑΩñ≥((|to|))ñ╦║εñδíú((|to|))ñ≥╩╓ñ╣íú
  429.     :Parameters:
  430.       : ((|to|))
  431.         ╜╨╬╧└Φíú((|<<|))ÑßÑ╜Ñ├Ñ╔ñ¼╔¼═╫íúÑ╟Ñ╒Ñ⌐ÑδÑ╚ñ╧(({[]}))íú
  432.       : ((|width|))
  433.         ║╕┬ªíóѬÑ╫Ñ╖ÑτÑ≤ÑΩÑ╣Ñ╚╔⌠ñ╬╔²íúÑ╟Ñ╒Ñ⌐ÑδÑ╚ñ╧((|@summary_width|))íú
  434.       : ((|max|))
  435.         ║╕┬ªñ╟╗╚ñ¿ñδ║╟┬τ╔²íúÑ╟Ñ╒Ñ⌐ÑδÑ╚ñ╧(({((|width|)) - 1}))íú
  436.       : ((|indent|))
  437.         ÑñÑ≤Ñ╟Ñ≤Ñ╚íúÑ╟Ñ╒Ñ⌐ÑδÑ╚ñ╧((|@summary_indent|))íú
  438.       : (({Block}))
  439.         ÑñÑ╞Ñ∞í╝Ñ┐ñ╚ñ╖ñ╞╕╞ñ╨ñ∞ñ╞ñññδñ╚íó│╞╣╘ñ┤ñ╚ñ╦╕╞ñ╙╜╨ñ╡ñ∞ñδíú
  440. =end #'#"#`#
  441. =begin
  442. --- OptionParser#to_str
  443. --- OptionParser#to_s
  444.     Ñ¬Ñ╫Ñ╖ÑτÑ≤Ñ╡Ñ▐ÑΩ╩╕╗·╬≤ñ≥╩╓ñ╣íú
  445. =end #'#"#`#
  446. =begin
  447. --- OptionParser#to_a
  448.     Ñ¬Ñ╫Ñ╖ÑτÑ≤Ñ╡Ñ▐ÑΩñ≥╟█╬≤ñ╚ñ╖ñ╞╩╓ñ╣íú
  449. =end #'#"#`#
  450. =begin
  451. --- OptionParser#switch
  452.     ((<OptionParser::Switch>))ñ≥║εñδíú
  453.     :Parameters:
  454.       : ((|opts|))
  455.         Ñ¬Ñ╫Ñ╖ÑτÑ≤─Ω╡┴íú
  456.         : ░·┐⌠Ñ╣Ñ┐ÑñÑδ
  457.           ((<OptionParser::ArgumentStyle>))╗▓╛╚íú
  458.         : ░·┐⌠Ñ╤Ñ┐í╝Ñ≤
  459.           ╝⌡ñ▒╔╒ñ▒ñΘñ∞ñδѬÑ╫Ñ╖ÑτÑ≤░·┐⌠ñ╬╖┴╝░íú((<OptionParser.accept>))ñΣ
  460.           ((<OptionParser#accept>))ñ╟ñóñΘñ½ñ╕ñß─Ω╡┴ñ╡ñ∞ñ╞ñññδñ½íó
  461.           (({Regexp}))ñ╩ñ╔ñ╬(({match}))ÑßÑ╜Ñ├Ñ╔ñ≥╗²ñ─ѬÑ╓Ñ╕ѺѻÑ╚ñ╟ñ╩ñ▒ñ∞
  462.           ñ╨ñ╩ñΘñ╩ññíúñ│ñ∞ñ╧░∞┼┘ñ└ñ▒╗╪─Ωñ╟ñ¡ñδ(ñΓñ╖ñ╩ñ▒ñ∞ñ╨(({Object}))ñ╚
  463.           ñ▀ñ╩ñ╡ñ∞ñδ)ñ¼íóñ╡ñΓñ╩ñ▒ñ∞ñ╨(({ArgumentError}))ñ≥╡»ñ│ñ╣íú
  464.           
  465.           cf. ((<░·┐⌠ñ╚ñ╖ñ╞╝⌡ñ▒╔╒ñ▒ñΘñ∞ñδÑ»ÑΘÑ╣>)).
  466.         : Hash
  467.         : Array
  468.           ╝ΦñΩ╞└ñδ░·┐⌠ñ╬├═íú
  469.         : Proc
  470.         : Method
  471.           ((*handler*))ñ≥═┐ñ¿ñδ╩╠ñ╬╝Ω├╩íú
  472.         : "--switch=MANDATORY", "--switch[=OPTIONAL]", "--switch"
  473.           ñ╜ñ∞ñ╛ñ∞░·┐⌠ñ¼╔¼┐▄íó╛╩╬¼▓─╟╜íó╠╡ñ╖ñ╬─╣╖┴╝░Ñ╣ÑñÑ├Ñ┴íú
  474.         : "-xMANDATORY", "-x[OPTIONAL]", "-x"
  475.           ñ╜ñ∞ñ╛ñ∞░·┐⌠ñ¼╔¼┐▄íó╛╩╬¼▓─╟╜íó╠╡ñ╖ñ╬├╗╖┴╝░Ñ╣ÑñÑ├Ñ┴íú
  476.         : "-[a-z]MANDATORY", "-[a-z][OPTIONAL]", "-[a-z]"
  477.           Ñ¡ÑπÑΘÑ»Ñ┐Ñ»ÑΘÑ╣ñ╦Ñ▐Ñ├Ñ┴ñ╣ñδ├╗╖┴╝░ñ╬Ñ╣ÑñÑ├Ñ┴
  478.           (└╡╡¼╔╜╕╜┴┤ñ╞ñ¼╗╚ñ¿ñδñ∩ñ▒ñ╟ñ╧ñ╩ññ)íú
  479.         : "=MANDATORY", "=[OPTIONAL]"
  480.           ░·┐⌠Ñ╣Ñ┐ÑñÑδíú
  481.         : "description", ...
  482.           ñ│ñ╬Ñ╣ÑñÑ├Ñ┴ñ╬└Γ╠└íú
  483.       : (({Block}))
  484.         ñ│ñ╬Ñ╣ÑñÑ├Ñ┴ñ¼╗╪─Ωñ╡ñ∞ñ┐ñ╚ñ¡ñ╦╕╞ñ╙╜╨ñ╡ñ∞ñδ((*handler*))íú
  485. =end #'#"#`#
  486. =begin
  487. --- OptionParser#on(*opts) [{...}]
  488. --- OptionParser#def_option(*opts) [{...}]
  489. --- OptionParser#on_head(*opts) [{...}]
  490. --- OptionParser#def_head_option(*opts) [{...}]
  491. --- OptionParser#on_tail(*opts) [{...}]
  492. --- OptionParser#def_tail_option(*opts) [{...}]
  493.     Ñ¬Ñ╫Ñ╖ÑτÑ≤Ñ╣ÑñÑ├Ñ┴ñ╚Ñ╧Ñ≤Ñ╔ÑΘñ≥─Ω╡┴ñ╣ñδíú(({on_head}))íó(({def_head_option}))ñ╚
  494.     (({on_tail}))íó(({def_tail_option}))ñ╧ñ╜ñ∞ñ╛ñ∞Ñ╣ÑñÑ├Ñ┴ñ≥Ñ╡Ñ▐ÑΩñ╬║╟
  495.     ╜Θñ╚║╟╕σñ╦ñ¬ñ»íú
  496.  
  497.     cf. ((<OptionParser#switch>)).
  498. =end #'#"#`#
  499. =begin
  500. --- OptionParser#order(*argv) [{...}]
  501. --- OptionParser#order!([argv = ARGV]) [{...}]
  502.     ((|argv|))ñ≥╜╨ñ╞═Φñδ╜τ╚╓ñ╦ñ╖ñ┐ñ¼ñ├ñ╞▓≥└╧ñ╣ñδíúѬÑ╫Ñ╖ÑτÑ≤ñ╟ñ╩ññ░·┐⌠ñ¼
  503.     ñóñδñ╚íóÑñÑ╞Ñ∞í╝Ñ┐ñ╚ñ╖ñ╞╕╞ñ╨ñ∞ñ╞ñññ∞ñ╨ñ╜ñ∞ñ≥┼╧ñ╖ñ╞╕╞ñ╙╜╨ñ╣íúñ╡ñΓñ╩ñ▒
  504.     ñ∞ñ╨▓≥└╧ñ≥╜¬╬╗ñ╣ñδíú
  505.     ▓≥└╧ñ╡ñ∞ñ║ñ╦╗─ñ├ñ┐((|argv|))ñ≥╩╓ñ╣íú
  506.     
  507.     (({order!}))ñ╧╟█╬≤╝½┐╚ñ≥╝⌡ñ▒╝Φñ├ñ╞íóÑ╣ÑñÑ├Ñ┴ñ≥╟╦▓⌡┼¬ñ╦╝ΦñΩ╜ⁿñ»íú
  508.     Ñ╟Ñ╒Ñ⌐ÑδÑ╚ñ╟ñ╧((|ARGV|))ñ≥▓≥└╧ñ╣ñδíú
  509.     :Parameters:
  510.       : ((|argv|))
  511.         ▓≥└╧ñ╣ñδÑ│Ñ▐Ñ≤Ñ╔ÑΘÑñÑ≤░·┐⌠ñ╬╟█╬≤íú
  512.       : (({Block}))
  513.         Ñ¬Ñ╫Ñ╖ÑτÑ≤ñ╟ñ╩ññ░·┐⌠ñ¼ñóñδñ╚╕╞ñ╙╜╨ñ╡ñ∞ñδíú
  514. =end #'#"#`#
  515. =begin
  516. --- OptionParser#permute(*argv)
  517. --- OptionParser#permute!([argv = ARGV])
  518.     ((|argv|))ñ≥╩┬ñ╙╩╤ñ¿ÑΓí╝Ñ╔ñ╟▓≥└╧ñ╖ñ╞íóѬÑ╫Ñ╖ÑτÑ≤ñ╟ñ╩ññ░·┐⌠ñ╬ÑΩÑ╣Ñ╚ñ≥
  519.     ╩╓ñ╣íú
  520.     
  521.     (({permute!}))ñ╧╟█╬≤╝½┐╚ñ≥╝⌡ñ▒╝Φñ├ñ╞íóÑ╣ÑñÑ├Ñ┴ñ≥╟╦▓⌡┼¬ñ╦╝ΦñΩ╜ⁿñ»íú
  522.     Ñ╟Ñ╒Ñ⌐ÑδÑ╚ñ╟ñ╧((|ARGV|))ñ≥▓≥└╧ñ╣ñδíú
  523.     :Parameters:
  524.       : ((|argv|))
  525.         ▓≥└╧ñ╣ñδÑ│Ñ▐Ñ≤Ñ╔ÑΘÑñÑ≤░·┐⌠ñ╬╟█╬≤íú
  526. =end #'#"#`#
  527. =begin
  528. --- OptionParser#parse(*argv)
  529. --- OptionParser#parse!([argv = ARGV])
  530.     ┤─╢¡╩╤┐⌠(({POSIXLY_CORRECT}))ñ¼Ñ╗Ñ├Ñ╚ñ╡ñ∞ñ╞ñññδñ╚ñ¡ñ╧╜τ╜°─╠ñΩñ╦íóñ╜
  531.     ñ∞░╩│░ñ╧╩┬ñ┘╩╤ñ¿ÑΓí╝Ñ╔ñ╟íó((|argv|))ñ≥▓≥└╧ñ╣ñδíú
  532.  
  533.     (({parse!}))ñ╧╟█╬≤╝½┐╚ñ≥╝⌡ñ▒╝Φñ├ñ╞íóÑ╣ÑñÑ├Ñ┴ñ≥╟╦▓⌡┼¬ñ╦╝ΦñΩ╜ⁿñ»íú
  534.     Ñ╟Ñ╒Ñ⌐ÑδÑ╚ñ╟ñ╧((|ARGV|))ñ≥▓≥└╧ñ╣ñδíú
  535.     :Parameters:
  536.       : ((|argv|))
  537.         ▓≥└╧ñ╣ñδÑ│Ñ▐Ñ≤Ñ╔ÑΘÑñÑ≤░·┐⌠ñ╬╟█╬≤íú
  538. =end #'#"#`#
  539. =begin private
  540. --- OptionParser#visit(id, *args) {block}
  541.     (({Ñ╣Ñ┐Ñ├Ñ»}))ñ╦┬╨ñ╖ñ╞ÑßÑ╜Ñ├Ñ╔((|id|))ñ≥((|*args|))ñ╚╢ªñ╦╕╞ñ╙╜╨ñ╣íú
  542.     :Parameters:
  543.       : ((|id|))
  544.         (({Ñ╣Ñ┐Ñ├Ñ»}))ñ╬│╞═╫┴╟ñ╦┬╨ñ╖ñ╞╕╞ñ╙╜╨ñ╣ÑßÑ╜Ñ├Ñ╔íú
  545.       : ((|*args|))
  546.         ((|id|))ñ╦┼╧ñ╡ñ∞ñδíú
  547.       : (({Block}))
  548.         ((|id|))ñ╦┼╧ñ╡ñ∞ñδíú
  549. =end #'#"#`#
  550. =begin private
  551. --- OptionParser#search(id, k)
  552.     ((|k|))ñ≥((|id|))ñ╬Ñ╧Ñ├Ñ╖Ñσñ╬Ñ╣Ñ┐Ñ├Ñ»ñ½ñΘ├╡ñ╖ñ╞╕½╔╒ñ½ñ├ñ┐├═ñ≥╩╓ñ╣íú
  553.     ÑñÑ╞Ñ∞í╝Ñ┐ñ╚ñ╖ñ╞╕╞ñ╨ñ∞ñ╞ñññδñ╚ñ╜ñ╬├═ñ╟yieldñ╣ñδíú
  554.     :Parameters:
  555.       : ((|id|))
  556.         ╕í║≈ñ╣ñδÑ╞í╝Ñ╓Ñδíú
  557.       : ((|k|))
  558.         ╕í║≈ñ╣ñδÑ¡í╝íú
  559.       : (({Block}))
  560.         Ñ¡í╝ñ¼╕½╔╒ñ½ñ├ñ┐ñ╚ñ¡ñ╦├═ñ╟yieldñ╡ñ∞ñδíú
  561. =end #'#"#`#
  562. =begin private
  563. --- OptionParser#complete(opt)
  564.     ╛╩╬¼ñ╡ñ∞ñ╞ñññδ─╣╖┴╝░ѬÑ╫Ñ╖ÑτÑ≤Ñ╣ÑñÑ├Ñ┴ñ≥╩Σ┤░ñ╖ñ╞íó└╡╡¼▓╜ñ╡ñ∞ñ┐Ñ╣ÑñÑ├
  565.     Ñ┴╠╛ñ╚Ñ╣ÑñÑ├Ñ┴ѬÑ╓Ñ╕ѺѻÑ╚((<OptionParser::Switch>))ñ╬Ñ┌Ñóñ≥╩╓ñ╣íú
  566.     :Parameters:
  567.       : ((|opt|))
  568.         ─╣╖┴╝░ѬÑ╫Ñ╖ÑτÑ≤Ñ╣ÑñÑ├Ñ┴((({'--'}))ñ╧ñ╩ñ╖)íú
  569. =end #'#"#`#
  570. =begin
  571. = ░·┐⌠ñ╚ñ╖ñ╞╝⌡ñ▒╔╒ñ▒ñΘñ∞ñδÑ»ÑΘÑ╣
  572. =end #'#"#`#
  573. =begin
  574. : Object
  575.   ╟ñ░╒ñ╬╩╕╗·╬≤íó╩╤┤╣ñ╡ñ∞ñ╩ññíú▓┐ñΓ╗╪─Ωñ╖ñ╩ñññ╚ñ│ñ∞ñ╦ñ╩ñδíú
  576. =end #'#"#`#
  577. =begin
  578. : String
  579.   ╟ñ░╒ñ╬╢⌡ñ╟ñ╩ññ╩╕╗·╬≤íó╩╤┤╣ñ╡ñ∞ñ╩ññíú
  580. =end #'#"#`#
  581. =begin
  582. : Integer
  583.   Ruby/C┼¬ñ╩└░┐⌠íó(({0}))ñ╟╗╧ñ▐ñ∞ñ╨8┐╩┐⌠íó(({0b}))ñ╟╗╧ñ▐ñ∞ñ╨2┐╩┐⌠íó
  584.   (({0x}))ñ╟╗╧ñ▐ñ∞ñ╨16┐╩┐⌠íóñ╜ñ∞░╩│░ñ╧10┐╩┐⌠ñ╚ñ▀ñ╩ñ╣íú╔Σ╣µñΓ╔╒ñ▒ñΘñ∞ñδíú
  585.   (({Integer}))ñ╦╩╤┤╣ñ╡ñ∞ñδíú
  586. =end #'#"#`#
  587. =begin
  588. : Float
  589.   ╝┬┐⌠╖┴╝░íó(({Float}))ñ╦╩╤┤╣ñ╡ñ∞ñδíú
  590. =end #'#"#`#
  591. =begin
  592. : Numeric
  593.   ╚╞═╤ñ╬┐⌠├═íó└░┐⌠╖┴╝░ñ╩ñΘ(({Integer}))íó╝┬┐⌠╖┴╝░ñ╩ñΘ
  594.   (({Float}))ñ╦╩╤┤╣ñ╡ñ∞ñδíú
  595. =end #'#"#`#
  596. =begin
  597. : OptionParser::DecimalInteger
  598.   10┐╩└░┐⌠íó(({Integer}))ñ╦╩╤┤╣ñ╡ñ∞ñδíú
  599. =end #'#"#`#
  600. =begin
  601. : OptionParser::OctalInteger
  602.   Ruby/C┼¬ñ╩ 8/16/2┐╩└░┐⌠íó(({Integer}))ñ╦╩╤┤╣ñ╡ñ∞ñδíú
  603. =end #'#"#`#
  604. =begin
  605. : OptionParser::DecimalNumeric
  606.   10┐╩└░┐⌠í┐╝┬┐⌠╖┴╝░íú└░┐⌠╖┴╝░ñ╩ñΘ(({Integer}))íó╝┬┐⌠╖┴╝░ñ╩ñΘ
  607.   (({Float}))ñ╦╩╤┤╣ñ╡ñ∞ñδíú
  608. =end #'#"#`#
  609. =begin
  610. : TrueClass
  611.   Ñ╓í╝ÑΩÑóÑ≤Ñ╣ÑñÑ├Ñ┴íó┬╕║▀ñ╣ñ∞ñ╨┐┐íóñ▐ñ┐ñ╧(({no-}))ñ¼┴░ñ╦╔╒ñññ╞ñññ∞ñ╨╡╢íú
  612.   ñΓñ╖ñ»ñ╧(({yes/no/true/false}))ñ╟╝¿ñ╡ñ∞ñδ├═íú
  613. : FalseClass
  614.   ((<TrueClass>))ñ╚╗≈ñ╞ñññδñ¼íóÑ╟Ñ╒Ñ⌐ÑδÑ╚ñ╬├═ñ╧(({false}))íú
  615. =end #'#"#`#
  616. =begin
  617. : Array
  618.   ","╢Φ└┌ñΩ╩╕╗·╬≤íú
  619. =end #'#"#`#
  620. =begin
  621. = ╬π│░
  622. =end #'#"#`#
  623. =begin
  624. == ((:OptionParser::ParseError:))
  625. ((<OptionParser>))ñ╟╚»└╕ñ╣ñδ╬π│░ñ╬Ñ┘í╝Ñ╣Ñ»ÑΘÑ╣íú
  626. === Ñ╣í╝Ñ╤í╝Ñ»ÑΘÑ╣
  627. (({RuntimeError}))
  628. === ─Ω┐⌠
  629. : OptionParser::ParseError::Reason
  630.   Ñ¿ÑΘí╝╕╢░°íú
  631. === ÑñÑ≤Ñ╣Ñ┐Ñ≤Ñ╣ÑßÑ╜Ñ├Ñ╔
  632. --- OptionParser::ParseError#reason
  633.     Ñ¿ÑΘí╝ñ╬═²═│ñ≥╩╓ñ╣íú
  634. --- OptionParser::ParseError#inspect
  635.     ▓─╞╔╖┴╝░ñ╬╩╕╗·╬≤ñ≥╩╓ñ╣íú
  636. --- OptionParser::ParseError#message
  637. --- OptionParser::ParseError#to_s
  638. --- OptionParser::ParseError#to_str
  639.     Ñ╟Ñ╒Ñ⌐ÑδÑ╚ñ╬╩╕╗·╬≤▓╜ÑßÑ╜Ñ├Ñ╔íó╔╕╜α┼¬ñ╩Ñ¿ÑΘí╝ÑßÑ├Ñ╗í╝Ñ╕═╤íú
  640. =end #'#"#`#
  641. =begin
  642. == ((:OptionParser::AmbiguousOption:))
  643. ╩Σ┤░ñ¼░∞░╒ñ╦╖ΦñßñΘñ∞ñ╩ñññ╚ñ¡ñ╦╚»└╕ñ╣ñδíú
  644. === Ñ╣í╝Ñ╤í╝Ñ»ÑΘÑ╣
  645. ((<OptionParser::ParseError>))
  646. =end #'#"#`#
  647. =begin
  648. == ((:OptionParser::NeedlessArgument:))
  649. ░·┐⌠ñ≥╝ΦñΘñ╩ññÑ╣ÑñÑ├Ñ┴ñ╦░·┐⌠ñ¼╗╪─Ωñ╡ñ∞ñ╞ñññ┐ñ╚ñ¡ñ╦╚»└╕ñ╣ñδíú
  650. === Ñ╣í╝Ñ╤í╝Ñ»ÑΘÑ╣
  651. ((<OptionParser::ParseError>))
  652. =end #'#"#`#
  653. =begin
  654. == ((:OptionParser::MissingArgument:))
  655. ░·┐⌠ñ¼╔¼═╫ñ╩Ñ╣ÑñÑ├Ñ┴ñ╦░·┐⌠ñ¼╠╡ñ½ñ├ñ┐ñ╚ñ¡ñ╦╚»└╕ñ╣ñδíú
  656. === Ñ╣í╝Ñ╤í╝Ñ»ÑΘÑ╣
  657. ((<OptionParser::ParseError>))
  658. =end #'#"#`#
  659. =begin
  660. == ((:OptionParser::InvalidOption:))
  661. ─Ω╡┴ñ╡ñ∞ñ╞ñññ╩ññÑ╣ÑñÑ├Ñ┴ñ╟╚»└╕ñ╣ñδíú
  662. === Ñ╣í╝Ñ╤í╝Ñ»ÑΘÑ╣
  663. ((<OptionParser::ParseError>))
  664. =end #'#"#`#
  665. =begin
  666. == ((:OptionParser::InvalidArgument:))
  667. ═┐ñ¿ñΘñ∞ñ┐░·┐⌠ñ¼Ñ╒Ñ⌐í╝Ñ▐Ñ├Ñ╚ñ╦╣τñ∩ñ╩ñ½ñ├ñ┐ñ╚ñ¡ñ╦╚»└╕ñ╣ñδíú
  668. === Ñ╣í╝Ñ╤í╝Ñ»ÑΘÑ╣
  669. ((<OptionParser::ParseError>))
  670. =end #'#"#`#
  671. =begin
  672. == ((:OptionParser::AmbiguousArgument:))
  673. ═┐ñ¿ñΘñ∞ñ┐░·┐⌠ñ¼░∞░╒ñ╦╖Φ─Ωñ╟ñ¡ñ╩ñ½ñ├ñ┐ñ╚ñ¡ñ╦╚»└╕ñ╣ñδíú
  674. === Ñ╣í╝Ñ╤í╝Ñ»ÑΘÑ╣
  675. ((<OptionParser::InvalidArgument>))
  676. =end #'#"#`#
  677. =begin
  678. = ñ╜ñ╬┬╛
  679. =end #'#"#`#
  680. =begin
  681. == ((:OptionParser::Arguable:))
  682. Ñ│Ñ▐Ñ≤Ñ╔ÑΘÑñÑ≤░·┐⌠ñ╬╟█╬≤ñ╦íó╝½╩¼╝½┐╚ñ≥Ñ╤í╝Ñ╣ñ╣ñδ╡í╟╜ñ≥│╚─Ññ╣ñδíú
  683. (({optparse.rb}))ñ≥(({require}))ñ╣ñδñ╚íó((|ARGV|))ñ¼│╚─Ññ╡ñ∞ñ╞ñññδíú
  684. =end #'#"#`#
  685. =begin
  686. --- OptionParser::Arguable#options=
  687.     ((<OptionParser>))ѬÑ╓Ñ╕ѺѻÑ╚ñ≥Ñ╗Ñ├Ñ╚ñ╣ñδíú
  688.     ((|opt|))ñ¼(({false}))ñ½(({nil}))ñ╩ñΘíó
  689.     ((<OptionParser::Arguable#options>))ÑßÑ╜Ñ├Ñ╔ñ╚
  690.     ((<OptionParser::Arguable#options=>))ÑßÑ╜Ñ├Ñ╔ñ¼╠ñ─Ω╡┴ñ╦ñ╡ñ∞ñδíú
  691.     ñ─ñ▐ñΩíóñ│ñ╬Ñ∞Ñ╖í╝Ñ╨╖╨═│ñ╟((<OptionParser>))ѬÑ╓Ñ╕ѺѻÑ╚ñ╦ÑóÑ»Ñ╗Ñ╣
  692.     ñ╣ñδ╩²╦íñ╧╠╡ñ»ñ╩ñδíú
  693. =end #'#"#`#
  694. =begin
  695. --- OptionParser::Arguable#options [{...}]
  696.     ╝┬║▌ñ╬((<OptionParser>))ѬÑ╓Ñ╕ѺѻÑ╚íú
  697.     └▀─Ωñ╡ñ∞ñ╞ñññ╩ñ▒ñ∞ñ╨╝½╞░┼¬ñ╦║εñΘñ∞ñδíú
  698.  
  699.     ÑñÑ╞Ñ∞í╝Ñ┐ñ╚ñ╖ñ╞╕╞ñ╨ñ∞ñδñ╚íó((<OptionParser>))ѬÑ╓Ñ╕ѺѻÑ╚ñ╚╢ªñ╦╕╞ñ╙╜╨ñ╖ñ╞íó
  700.     ñ╜ñ╬╖δ▓╠ñ≥╠ßñΩ├═ñ╚ñ╣ñδíúñ│ñ╬ñ╚ñ¡íó((<OptionParser::ParseError>))╬π│░ñ╧╩Σ┬¡ñ╡ñ∞íó
  701.     Ñ¿ÑΘí╝ÑßÑ├Ñ╗í╝Ñ╕ñ≥((<STDERR>))ñ╦╔╜╝¿ñ╣ñδñ└ñ▒ñ╟(({nil}))ñ≥╩╓ñ╣íú
  702.  
  703.     :Parameters:
  704.       : (({block}))
  705.         └▀─Ωñ╡ñ∞ñ╞ñññδ((<OptionParser>))ñ╬ÑñÑ≤Ñ╣Ñ┐Ñ≤Ñ╣ñ╚ñ╚ñΓñ╦╕╞ñ╨ñ∞ñδíú
  706. =end #'#"#`#
  707. =begin
  708. --- OptionParser::Arguable#order!
  709. --- OptionParser::Arguable#permute!
  710. --- OptionParser::Arguable#parse!
  711.     ((|self|))ñ≥╟╦▓⌡┼¬ñ╦Ñ╤í╝Ñ╣ñ╖ñ╞íó((|self|))ñ≥╩╓ñ╣íúÑ╤í╝Ñ╣ñ╡ñ∞ñ╩ñ½ñ├ñ┐
  712.     ╩╕╗·╬≤ñ└ñ▒ñ≥╗─ñ╣íú
  713. =end #'#"#`#
  714. =begin
  715. == ((:OptionParser::Acceptables:))
  716. ((<OptionParser>))ñ╟─Ω╡┴ñ╡ñ∞ñ╞ñññδíó░·┐⌠ñ╚ñ╖ñ╞╝⌡ñ▒╔╒ñ▒ñΘñ∞ñδÑ╤Ñ┐í╝Ñ≤ñ╬─Ω┐⌠ñ≥┤▐ñ≤ñ╟ñññδíú
  717. ║úñ╬ñ╚ñ│ñφ(({DecimalInteger}))íó(({OctalInteger}))íó(({DecimalNumeric}))íú
  718. ((<░·┐⌠ñ╚ñ╖ñ╞╝⌡ñ▒╔╒ñ▒ñΘñ∞ñδÑ»ÑΘÑ╣>))╗▓╛╚íú
  719. =end #'#"#`#
  720. =begin example
  721. = Example
  722. <<< opttest.rb
  723. =end #'#"#`#
  724.