optiflag 0.6 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. data/ReleaseNotes.txt +35 -0
  2. data/doc/classes/OptiFlag.html +439 -0
  3. data/doc/classes/OptiFlag.src/M000001.html +49 -0
  4. data/doc/classes/OptiFlag.src/M000002.html +49 -0
  5. data/doc/classes/OptiFlag.src/M000003.html +30 -0
  6. data/doc/classes/OptiFlag/Flagset.html +459 -0
  7. data/doc/classes/OptiFlag/Flagset.src/M000003.html +45 -0
  8. data/doc/classes/OptiFlag/Flagset.src/M000004.html +45 -0
  9. data/doc/classes/OptiFlag/Flagset.src/M000005.html +18 -0
  10. data/doc/classes/OptiFlag/Flagset.src/M000006.html +20 -0
  11. data/doc/classes/OptiFlag/Flagset.src/M000007.html +35 -0
  12. data/doc/classes/OptiFlag/Flagset.src/M000008.html +23 -0
  13. data/doc/classes/OptiFlag/Flagset.src/M000009.html +24 -0
  14. data/doc/classes/OptiFlag/Flagset.src/M000010.html +28 -0
  15. data/doc/classes/OptiFlag/Flagset.src/M000011.html +20 -0
  16. data/doc/classes/OptiFlag/Flagset.src/M000012.html +24 -0
  17. data/doc/classes/OptiFlag/Flagset.src/M000013.html +24 -0
  18. data/doc/classes/OptiFlag/Flagset.src/M000014.html +32 -0
  19. data/doc/classes/OptiFlag/Flagset.src/M000015.html +25 -0
  20. data/doc/classes/OptiFlag/Flagset.src/M000016.html +53 -0
  21. data/doc/classes/OptiFlag/Flagset.src/M000017.html +53 -0
  22. data/doc/classes/OptiFlag/Flagset/EachFlag.html +930 -0
  23. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000024.html +36 -0
  24. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000025.html +18 -0
  25. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000026.html +36 -0
  26. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000027.html +36 -0
  27. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000028.html +18 -0
  28. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000029.html +18 -0
  29. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000030.html +19 -0
  30. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000031.html +19 -0
  31. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000032.html +18 -0
  32. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000033.html +18 -0
  33. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000034.html +18 -0
  34. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000035.html +22 -0
  35. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000036.html +19 -0
  36. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000037.html +18 -0
  37. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000038.html +18 -0
  38. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000039.html +18 -0
  39. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000040.html +18 -0
  40. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000041.html +18 -0
  41. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000042.html +18 -0
  42. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000043.html +19 -0
  43. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000044.html +18 -0
  44. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000045.html +19 -0
  45. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000046.html +18 -0
  46. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000047.html +18 -0
  47. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000048.html +18 -0
  48. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000049.html +18 -0
  49. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000050.html +18 -0
  50. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000051.html +18 -0
  51. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000052.html +20 -0
  52. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000053.html +18 -0
  53. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000054.html +18 -0
  54. data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000055.html +22 -0
  55. data/doc/classes/OptiFlag/Flagset/Errors.html +192 -0
  56. data/doc/classes/OptiFlag/Flagset/Errors.src/M000021.html +18 -0
  57. data/doc/classes/OptiFlag/Flagset/Errors.src/M000022.html +19 -0
  58. data/doc/classes/OptiFlag/Flagset/Errors.src/M000023.html +18 -0
  59. data/doc/classes/OptiFlag/Flagset/Errors.src/M000024.html +18 -0
  60. data/doc/classes/OptiFlag/Flagset/Errors.src/M000025.html +19 -0
  61. data/doc/classes/OptiFlag/Flagset/Errors.src/M000026.html +36 -0
  62. data/doc/classes/OptiFlag/Flagset/Help.html +125 -0
  63. data/doc/classes/OptiFlag/Flagset/Help/Bundle.html +160 -0
  64. data/doc/classes/OptiFlag/Flagset/Help/Bundle.src/M000018.html +18 -0
  65. data/doc/classes/OptiFlag/Flagset/Help/Bundle.src/M000019.html +18 -0
  66. data/doc/classes/OptiFlag/Flagset/Help/StandardHelpBundle.html +118 -0
  67. data/doc/classes/OptiFlag/Flagset/NewInterface.html +296 -0
  68. data/doc/classes/OptiFlag/Flagset/NewInterface.src/M000017.html +18 -0
  69. data/doc/classes/OptiFlag/Flagset/NewInterface.src/M000018.html +18 -0
  70. data/doc/classes/OptiFlag/Flagset/NewInterface.src/M000019.html +18 -0
  71. data/doc/classes/OptiFlag/Flagset/NewInterface.src/M000020.html +18 -0
  72. data/doc/classes/OptiFlag/Flagset/NewInterface.src/M000021.html +18 -0
  73. data/doc/classes/OptiFlag/Flagset/NewInterface.src/M000022.html +18 -0
  74. data/doc/classes/OptiFlag/Flagset/NewInterface.src/M000023.html +18 -0
  75. data/doc/created.rid +1 -0
  76. data/doc/files/optiflag-help_rb.html +101 -0
  77. data/doc/files/optiflag-parse_rb.html +101 -0
  78. data/doc/files/optiflag_rb.html +167 -0
  79. data/doc/files/optiflag_rb.src/M000001.html +18 -0
  80. data/doc/fr_class_index.html +34 -0
  81. data/doc/fr_file_index.html +29 -0
  82. data/doc/fr_method_index.html +82 -0
  83. data/doc/index.html +24 -0
  84. data/doc/rdoc-style.css +208 -0
  85. data/examples/example_1.rb +21 -0
  86. data/examples/example_1_1.rb +21 -0
  87. data/{doc/example → examples}/example_1_2.rb +8 -8
  88. data/examples/example_2.rb +31 -0
  89. data/{doc/example → examples}/example_2_1.rb +4 -4
  90. data/{doc/example → examples}/example_2_2.rb +7 -5
  91. data/{doc/example → examples}/example_2_3.rb +9 -9
  92. data/{doc/example → examples}/example_2_4.rb +4 -4
  93. data/{doc/example → examples}/example_2_5.rb +4 -4
  94. data/{doc/example → examples}/example_2_6.rb +6 -6
  95. data/{doc/example → examples}/example_3.rb +7 -6
  96. data/examples/example_6.rb +20 -0
  97. data/{doc/example → examples}/example_7.rb +5 -4
  98. data/examples/example_8.rb +26 -0
  99. data/optiflag-help.rb +42 -0
  100. data/optiflag-parse.rb +281 -0
  101. data/optiflag.gemspec +4 -3
  102. data/optiflag.rb +972 -0
  103. data/quick.rb +12 -0
  104. data/{test → testcases}/tc_advanced_usage_helping.rb +4 -0
  105. data/{test → testcases}/tc_basic_alternate_forms.rb +0 -0
  106. data/{test → testcases}/tc_basic_char_flags.rb +12 -12
  107. data/{test → testcases}/tc_basic_optional_flag.rb +0 -0
  108. data/{test → testcases}/tc_basic_parsing.rb +0 -0
  109. data/{test → testcases}/tc_basic_usage_helping.rb +0 -0
  110. data/{test → testcases}/tc_basic_value_validation.rb +0 -0
  111. data/{test → testcases}/tc_bug_one.rb +0 -0
  112. data/{test → testcases}/tc_bug_two.rb +0 -0
  113. data/{test → testcases}/tc_change_symbols.rb +0 -0
  114. data/{test → testcases}/tc_enumerated_value_validation.rb +0 -0
  115. data/{test → testcases}/tc_flagall.rb +4 -0
  116. data/{test → testcases}/tc_flagless_arg.rb +0 -0
  117. data/{test → testcases}/tc_keyword.rb +0 -0
  118. data/testcases/tc_new_basic_parsing.rb +51 -0
  119. data/testcases/tc_poro_tester.rb +30 -0
  120. data/{test → testcases}/tc_values_as_hash.rb +0 -0
  121. metadata +152 -52
  122. data/doc/example/example_1.rb +0 -30
  123. data/doc/example/example_1_1.rb +0 -27
  124. data/doc/example/example_2.rb +0 -28
  125. data/doc/example/example_4.rb +0 -12
  126. data/doc/example/example_5.rb +0 -26
  127. data/doc/example/example_6.rb +0 -17
  128. data/lib/optiflag.rb +0 -860
@@ -0,0 +1,45 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>parse (OptiFlag::Flagset)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File optiflag-parse.rb, line 3</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse</span>(<span class="ruby-identifier">args</span>,<span class="ruby-identifier">clone</span>=<span class="ruby-keyword kw">true</span>)
15
+ <span class="ruby-identifier">init_help_bundle</span>()
16
+ <span class="ruby-identifier">safe_args</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">clone</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">clone</span>
17
+ <span class="ruby-identifier">safe_args</span> = <span class="ruby-identifier">args</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span> <span class="ruby-identifier">clone</span>
18
+ <span class="ruby-comment cmt"># the following 10 lines were changed so</span>
19
+ <span class="ruby-comment cmt"># that a module could reparse a command-line</span>
20
+ <span class="ruby-comment cmt"># and not have a global-state change for</span>
21
+ <span class="ruby-comment cmt"># everyone... I had mulled just mandating that</span>
22
+ <span class="ruby-comment cmt"># a SomeArgModule::parse(ARGV) statement </span>
23
+ <span class="ruby-comment cmt"># could only occur once, but since everything else</span>
24
+ <span class="ruby-comment cmt"># is getting ugly, might as well allow this</span>
25
+ <span class="ruby-comment cmt"># --D.O.E 5/30/2006</span>
26
+ <span class="ruby-identifier">new_self</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">clone</span>
27
+ <span class="ruby-identifier">new_flags</span> = {}
28
+ <span class="ruby-ivar">@all_flags</span>.<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>,<span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
29
+ <span class="ruby-identifier">val</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">clone</span>
30
+ <span class="ruby-identifier">new_flags</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">val</span>
31
+ <span class="ruby-keyword kw">end</span>
32
+ <span class="ruby-identifier">new_self</span>.<span class="ruby-identifier">module_eval</span> <span class="ruby-keyword kw">do</span>
33
+ <span class="ruby-ivar">@all_flags</span> = <span class="ruby-identifier">new_flags</span>
34
+ <span class="ruby-identifier">safe_args</span> = <span class="ruby-identifier">search_for_missing_character_switches</span>(<span class="ruby-identifier">safe_args</span>)
35
+
36
+ <span class="ruby-identifier">safe_args</span> = <span class="ruby-identifier">create_api</span>(<span class="ruby-identifier">safe_args</span>)
37
+
38
+ <span class="ruby-identifier">safe_args</span> = <span class="ruby-identifier">search_for_missing_flags</span>(<span class="ruby-identifier">safe_args</span>)
39
+ <span class="ruby-identifier">populate_values</span>(<span class="ruby-identifier">safe_args</span>)
40
+ <span class="ruby-identifier">now_populate_hash</span>(<span class="ruby-ivar">@all_flags</span>,<span class="ruby-identifier">safe_args</span>)
41
+ <span class="ruby-keyword kw">end</span>
42
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">safe_args</span>
43
+ <span class="ruby-keyword kw">end</span></pre>
44
+ </body>
45
+ </html>
@@ -0,0 +1,45 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>parse (OptiFlag::Flagset)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File optiflag-parse.rb, line 3</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse</span>(<span class="ruby-identifier">args</span>,<span class="ruby-identifier">clone</span>=<span class="ruby-keyword kw">true</span>)
15
+ <span class="ruby-identifier">init_help_bundle</span>()
16
+ <span class="ruby-identifier">safe_args</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">clone</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">clone</span>
17
+ <span class="ruby-identifier">safe_args</span> = <span class="ruby-identifier">args</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span> <span class="ruby-identifier">clone</span>
18
+ <span class="ruby-comment cmt"># the following 10 lines were changed so</span>
19
+ <span class="ruby-comment cmt"># that a module could reparse a command-line</span>
20
+ <span class="ruby-comment cmt"># and not have a global-state change for</span>
21
+ <span class="ruby-comment cmt"># everyone... I had mulled just mandating that</span>
22
+ <span class="ruby-comment cmt"># a SomeArgModule::parse(ARGV) statement </span>
23
+ <span class="ruby-comment cmt"># could only occur once, but since everything else</span>
24
+ <span class="ruby-comment cmt"># is getting ugly, might as well allow this</span>
25
+ <span class="ruby-comment cmt"># --D.O.E 5/30/2006</span>
26
+ <span class="ruby-identifier">new_self</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">clone</span>
27
+ <span class="ruby-identifier">new_flags</span> = {}
28
+ <span class="ruby-ivar">@all_flags</span>.<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>,<span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
29
+ <span class="ruby-identifier">val</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">clone</span>
30
+ <span class="ruby-identifier">new_flags</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">val</span>
31
+ <span class="ruby-keyword kw">end</span>
32
+ <span class="ruby-identifier">new_self</span>.<span class="ruby-identifier">module_eval</span> <span class="ruby-keyword kw">do</span>
33
+ <span class="ruby-ivar">@all_flags</span> = <span class="ruby-identifier">new_flags</span>
34
+ <span class="ruby-identifier">safe_args</span> = <span class="ruby-identifier">search_for_missing_character_switches</span>(<span class="ruby-identifier">safe_args</span>)
35
+
36
+ <span class="ruby-identifier">safe_args</span> = <span class="ruby-identifier">create_api</span>(<span class="ruby-identifier">safe_args</span>)
37
+
38
+ <span class="ruby-identifier">safe_args</span> = <span class="ruby-identifier">search_for_missing_flags</span>(<span class="ruby-identifier">safe_args</span>)
39
+ <span class="ruby-identifier">populate_values</span>(<span class="ruby-identifier">safe_args</span>)
40
+ <span class="ruby-identifier">now_populate_hash</span>(<span class="ruby-ivar">@all_flags</span>,<span class="ruby-identifier">safe_args</span>)
41
+ <span class="ruby-keyword kw">end</span>
42
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">safe_args</span>
43
+ <span class="ruby-keyword kw">end</span></pre>
44
+ </body>
45
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>flag_symbol (OptiFlag::Flagset)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File optiflag.rb, line 40</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">flag_symbol</span>(<span class="ruby-identifier">val</span>)
15
+ <span class="ruby-ivar">@dash_symbol</span> = <span class="ruby-identifier">val</span>
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>increment_order_counter (OptiFlag::Flagset)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File optiflag.rb, line 43</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">increment_order_counter</span>()
15
+ <span class="ruby-ivar">@counter</span> <span class="ruby-operator">||=</span> <span class="ruby-value">0</span>
16
+ <span class="ruby-ivar">@counter</span> = <span class="ruby-ivar">@counter</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
17
+ <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@counter</span> <span class="ruby-operator">-</span><span class="ruby-value">1</span>
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -0,0 +1,35 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>flag (OptiFlag::Flagset)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File optiflag.rb, line 329</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">flag</span>(<span class="ruby-identifier">flag_name_pair</span>,<span class="ruby-identifier">hash</span>={},<span class="ruby-operator">&amp;</span><span class="ruby-identifier">the_block</span>)
15
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flag_name_pair</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">String</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">flag_name_pair</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Symbol</span>
16
+ <span class="ruby-identifier">flag_name_pair</span> = [<span class="ruby-identifier">flag_name_pair</span>.<span class="ruby-identifier">to_s</span>,<span class="ruby-identifier">flag_name_pair</span>.<span class="ruby-identifier">to_sym</span>]
17
+ <span class="ruby-keyword kw">end</span>
18
+ <span class="ruby-identifier">flag</span> = <span class="ruby-identifier">flag_name_pair</span>[<span class="ruby-value">0</span>]
19
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flag_name_pair</span>[<span class="ruby-value">1</span>]
20
+ <span class="ruby-identifier">name</span> = <span class="ruby-identifier">flag_name_pair</span>[<span class="ruby-value">1</span>]
21
+ <span class="ruby-keyword kw">else</span>
22
+ <span class="ruby-identifier">name</span> = <span class="ruby-identifier">flag</span>.<span class="ruby-identifier">to_sym</span>
23
+ <span class="ruby-keyword kw">end</span>
24
+ <span class="ruby-ivar">@all_flags</span> <span class="ruby-operator">||=</span> {}
25
+ <span class="ruby-identifier">obj</span> = <span class="ruby-ivar">@all_flags</span>[<span class="ruby-identifier">name</span>]
26
+ <span class="ruby-identifier">obj</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">EachFlag</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>,<span class="ruby-identifier">flag</span>,<span class="ruby-keyword kw">self</span>)
27
+ <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">instance_eval</span> <span class="ruby-operator">&amp;</span><span class="ruby-identifier">the_block</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
28
+ <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">fxn</span>,<span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
29
+ <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">fxn</span>,<span class="ruby-identifier">val</span>)
30
+ <span class="ruby-keyword kw">end</span>
31
+ <span class="ruby-ivar">@all_flags</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">obj</span>
32
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">obj</span>
33
+ <span class="ruby-keyword kw">end</span></pre>
34
+ </body>
35
+ </html>
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>optional_flag (OptiFlag::Flagset)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File optiflag.rb, line 350</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">optional_flag</span>(<span class="ruby-identifier">flag_name_pair</span>,<span class="ruby-identifier">hash</span>={},<span class="ruby-operator">&amp;</span><span class="ruby-identifier">the_block</span>)
15
+ <span class="ruby-identifier">flag</span>(<span class="ruby-identifier">flag_name_pair</span>,<span class="ruby-identifier">hash</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">the_block</span>)
16
+ <span class="ruby-identifier">flag_name_pair</span> = [<span class="ruby-identifier">flag_name_pair</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flag_name_pair</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">String</span>
17
+ <span class="ruby-identifier">name</span> = <span class="ruby-identifier">flag_name_pair</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">flag_name_pair</span>[<span class="ruby-value">0</span>]
18
+ <span class="ruby-identifier">flag_properties</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_sym</span> <span class="ruby-keyword kw">do</span>
19
+ <span class="ruby-identifier">optional</span>
20
+ <span class="ruby-keyword kw">end</span>
21
+ <span class="ruby-keyword kw">end</span></pre>
22
+ </body>
23
+ </html>
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>optional_switch_flag (OptiFlag::Flagset)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File optiflag.rb, line 359</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">optional_switch_flag</span>(<span class="ruby-identifier">flag_name_pair</span>,<span class="ruby-identifier">hash</span>={},<span class="ruby-operator">&amp;</span><span class="ruby-identifier">the_block</span>)
15
+ <span class="ruby-identifier">flag</span>(<span class="ruby-identifier">flag_name_pair</span>,<span class="ruby-identifier">hash</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">the_block</span>)
16
+ <span class="ruby-identifier">flag_name_pair</span> = [<span class="ruby-identifier">flag_name_pair</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flag_name_pair</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">String</span>
17
+ <span class="ruby-identifier">name</span> = <span class="ruby-identifier">flag_name_pair</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">flag_name_pair</span>[<span class="ruby-value">0</span>]
18
+ <span class="ruby-identifier">flag_properties</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_sym</span> <span class="ruby-keyword kw">do</span>
19
+ <span class="ruby-identifier">optional</span>
20
+ <span class="ruby-identifier">arity</span> <span class="ruby-value">0</span>
21
+ <span class="ruby-keyword kw">end</span>
22
+ <span class="ruby-keyword kw">end</span></pre>
23
+ </body>
24
+ </html>
@@ -0,0 +1,28 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>keyword (OptiFlag::Flagset)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File optiflag.rb, line 369</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">keyword</span>(<span class="ruby-identifier">flag_name_pair</span>,<span class="ruby-identifier">hash</span>={},<span class="ruby-operator">&amp;</span><span class="ruby-identifier">the_block</span>)
15
+ <span class="ruby-ivar">@all_keywords</span> <span class="ruby-operator">||=</span> []
16
+ <span class="ruby-ivar">@all_keywords</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">name</span>
17
+ <span class="ruby-identifier">flag</span>(<span class="ruby-identifier">flag_name_pair</span>,<span class="ruby-identifier">hash</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">the_block</span>)
18
+ <span class="ruby-identifier">flag_name_pair</span> = [<span class="ruby-identifier">flag_name_pair</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">flag_name_pair</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">String</span>
19
+ <span class="ruby-identifier">name</span> = <span class="ruby-identifier">flag_name_pair</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">flag_name_pair</span>[<span class="ruby-value">0</span>]
20
+ <span class="ruby-identifier">flag_properties</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_sym</span> <span class="ruby-keyword kw">do</span>
21
+ <span class="ruby-identifier">dash_symbol</span> <span class="ruby-value str">&quot;&quot;</span>
22
+ <span class="ruby-identifier">long_dash_symbol</span> <span class="ruby-value str">&quot;&quot;</span>
23
+ <span class="ruby-identifier">arity</span> <span class="ruby-value">0</span>
24
+ <span class="ruby-identifier">optional</span>
25
+ <span class="ruby-keyword kw">end</span>
26
+ <span class="ruby-keyword kw">end</span></pre>
27
+ </body>
28
+ </html>
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>flagless_arg (OptiFlag::Flagset)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File optiflag.rb, line 383</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">flagless_arg</span>(<span class="ruby-identifier">name</span>)
15
+ <span class="ruby-ivar">@all_flagless_arg</span> <span class="ruby-operator">||=</span> []
16
+ <span class="ruby-identifier">mine</span> = <span class="ruby-identifier">flag</span>(<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_sym</span>)
17
+ <span class="ruby-ivar">@all_flagless_arg</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">mine</span>
18
+ <span class="ruby-keyword kw">end</span></pre>
19
+ </body>
20
+ </html>
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>usage_flag (OptiFlag::Flagset)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File optiflag.rb, line 389</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">usage_flag</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
15
+ <span class="ruby-identifier">first</span>,<span class="ruby-operator">*</span><span class="ruby-identifier">rest</span> = <span class="ruby-identifier">args</span>
16
+ <span class="ruby-identifier">optional_flag</span> [<span class="ruby-identifier">first</span>] <span class="ruby-keyword kw">do</span>
17
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">for_help</span> = <span class="ruby-keyword kw">true</span>
18
+ <span class="ruby-identifier">description</span> <span class="ruby-value str">&quot;Help&quot;</span>
19
+ <span class="ruby-identifier">no_args</span>
20
+ <span class="ruby-identifier">alternate_forms</span> <span class="ruby-operator">*</span><span class="ruby-identifier">rest</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rest</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
21
+ <span class="ruby-keyword kw">end</span>
22
+ <span class="ruby-keyword kw">end</span></pre>
23
+ </body>
24
+ </html>
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>extended_help_flag (OptiFlag::Flagset)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File optiflag.rb, line 399</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">extended_help_flag</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
15
+ <span class="ruby-identifier">first</span>,<span class="ruby-operator">*</span><span class="ruby-identifier">rest</span> = <span class="ruby-identifier">args</span>
16
+ <span class="ruby-identifier">optional_flag</span> [<span class="ruby-identifier">first</span>] <span class="ruby-keyword kw">do</span>
17
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">for_extended_help</span> = <span class="ruby-keyword kw">true</span>
18
+ <span class="ruby-identifier">description</span> <span class="ruby-value str">&quot;Extended Help&quot;</span>
19
+ <span class="ruby-identifier">no_args</span>
20
+ <span class="ruby-identifier">alternate_forms</span> <span class="ruby-operator">*</span><span class="ruby-identifier">rest</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rest</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
21
+ <span class="ruby-keyword kw">end</span>
22
+ <span class="ruby-keyword kw">end</span></pre>
23
+ </body>
24
+ </html>
@@ -0,0 +1,32 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>character_flag (OptiFlag::Flagset)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File optiflag.rb, line 409</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">character_flag</span>(<span class="ruby-identifier">switch</span>,<span class="ruby-identifier">group</span>=<span class="ruby-value str">&quot;default&quot;</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">the_block</span>)
15
+ <span class="ruby-identifier">throw</span> <span class="ruby-value str">&quot;Character switches can only be 1 character long&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">switch</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
16
+ <span class="ruby-identifier">flag</span>(<span class="ruby-identifier">switch</span>.<span class="ruby-identifier">to_sym</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">the_block</span>)
17
+ <span class="ruby-ivar">@group</span> <span class="ruby-operator">||=</span> {}
18
+ <span class="ruby-identifier">the_flag_we_just_added</span> = <span class="ruby-ivar">@all_flags</span>[<span class="ruby-identifier">switch</span>.<span class="ruby-identifier">to_sym</span>]
19
+
20
+ <span class="ruby-identifier">key</span> = [<span class="ruby-identifier">group</span>.<span class="ruby-identifier">to_sym</span>,<span class="ruby-identifier">the_flag_we_just_added</span>.<span class="ruby-identifier">the_dash_symbol</span>]
21
+ <span class="ruby-comment cmt"># puts &quot;#{ key.join(',') }&quot;</span>
22
+ <span class="ruby-ivar">@group</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">||=</span> []
23
+ <span class="ruby-ivar">@group</span>[<span class="ruby-identifier">key</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">the_flag_we_just_added</span>
24
+ <span class="ruby-comment cmt"># re-assert ourselves</span>
25
+ <span class="ruby-identifier">flag</span> [<span class="ruby-identifier">switch</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">switch</span>] <span class="ruby-keyword kw">do</span>
26
+ <span class="ruby-identifier">optional</span>
27
+ <span class="ruby-identifier">arity</span> <span class="ruby-value">0</span>
28
+ <span class="ruby-identifier">compresses</span>
29
+ <span class="ruby-keyword kw">end</span>
30
+ <span class="ruby-keyword kw">end</span></pre>
31
+ </body>
32
+ </html>
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>flag_properties (OptiFlag::Flagset)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File optiflag.rb, line 427</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">flag_properties</span>(<span class="ruby-identifier">symb</span>,<span class="ruby-identifier">hash</span>={},<span class="ruby-operator">&amp;</span><span class="ruby-identifier">the_block</span>)
15
+ <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Block needed for flag_properties&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-identifier">block_given?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">hash</span><span class="ruby-operator">==</span>{}
16
+ <span class="ruby-ivar">@all_flags</span> <span class="ruby-operator">||=</span> {}
17
+ <span class="ruby-identifier">obj</span> = <span class="ruby-ivar">@all_flags</span>[<span class="ruby-identifier">symb</span>.<span class="ruby-identifier">to_sym</span>]
18
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">obj</span><span class="ruby-operator">==</span><span class="ruby-keyword kw">nil</span>
19
+ <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">instance_eval</span> <span class="ruby-operator">&amp;</span><span class="ruby-identifier">the_block</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
20
+ <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">fxn</span>,<span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
21
+ <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">fxn</span>,<span class="ruby-identifier">val</span>)
22
+ <span class="ruby-keyword kw">end</span>
23
+ <span class="ruby-keyword kw">end</span></pre>
24
+ </body>
25
+ </html>
@@ -0,0 +1,53 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>handle_errors_and_help (OptiFlag::Flagset)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File optiflag.rb, line 682</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_errors_and_help</span>(<span class="ruby-identifier">level</span>=<span class="ruby-identifier">:not_strict</span>)
15
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@all_flags</span>
16
+ <span class="ruby-identifier">usage_flag</span> <span class="ruby-value str">&quot;h&quot;</span>,<span class="ruby-value str">&quot;?&quot;</span> <span class="ruby-comment cmt"># make this part of the standard config</span>
17
+ <span class="ruby-identifier">properties</span> <span class="ruby-value str">&quot;h&quot;</span>, <span class="ruby-identifier">:long_form=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;help&quot;</span>
18
+ <span class="ruby-identifier">parse</span>(<span class="ruby-constant">ARGV</span>,<span class="ruby-keyword kw">false</span>)
19
+ <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">help_requested?</span>
20
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">help_requested_on</span>
21
+ <span class="ruby-identifier">show_help</span>
22
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">the_on</span> = <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">help_requested_on</span>
23
+ <span class="ruby-identifier">show_individual_extended_help</span>(<span class="ruby-identifier">the_on</span>.<span class="ruby-identifier">to_sym</span>)
24
+ <span class="ruby-keyword kw">end</span>
25
+ <span class="ruby-identifier">exit</span>
26
+ <span class="ruby-keyword kw">end</span>
27
+ <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">extended_help_requested?</span>
28
+ <span class="ruby-identifier">show_extended_help</span>
29
+ <span class="ruby-identifier">exit</span>
30
+ <span class="ruby-keyword kw">end</span>
31
+ <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">errors?</span>
32
+ <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">divulge_problems</span>
33
+ <span class="ruby-identifier">show_help</span>
34
+ <span class="ruby-identifier">exit</span>
35
+ <span class="ruby-keyword kw">end</span>
36
+ <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">warnings?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">level</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:with_no_warnings</span>
37
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;In strict warning handling mode. Warnings will cause process to exit.&quot;</span>
38
+ <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">warnings</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span>
39
+ <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot; #{ x }&quot;</span>
40
+ <span class="ruby-keyword kw">end</span>
41
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Please fix these warnings and try again.&quot;</span>
42
+ <span class="ruby-identifier">exit</span>
43
+ <span class="ruby-keyword kw">end</span>
44
+ <span class="ruby-comment cmt"># the next three lines augment the </span>
45
+ <span class="ruby-comment cmt"># name of the module that the user</span>
46
+ <span class="ruby-comment cmt"># has declared... not just ARGV.</span>
47
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">extend</span> <span class="ruby-constant">NewInterface</span>
48
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">flag_value</span> = <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">flag_value</span>
49
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">errors</span> = <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">errors</span>
50
+ <span class="ruby-constant">ARGV</span>
51
+ <span class="ruby-keyword kw">end</span></pre>
52
+ </body>
53
+ </html>
@@ -0,0 +1,53 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>handle_errors_and_help (OptiFlag::Flagset)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre><span class="ruby-comment cmt"># File optiflag.rb, line 682</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_errors_and_help</span>(<span class="ruby-identifier">level</span>=<span class="ruby-identifier">:not_strict</span>)
15
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@all_flags</span>
16
+ <span class="ruby-identifier">usage_flag</span> <span class="ruby-value str">&quot;h&quot;</span>,<span class="ruby-value str">&quot;?&quot;</span> <span class="ruby-comment cmt"># make this part of the standard config</span>
17
+ <span class="ruby-identifier">properties</span> <span class="ruby-value str">&quot;h&quot;</span>, <span class="ruby-identifier">:long_form=</span><span class="ruby-operator">&gt;</span><span class="ruby-value str">&quot;help&quot;</span>
18
+ <span class="ruby-identifier">parse</span>(<span class="ruby-constant">ARGV</span>,<span class="ruby-keyword kw">false</span>)
19
+ <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">help_requested?</span>
20
+ <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">help_requested_on</span>
21
+ <span class="ruby-identifier">show_help</span>
22
+ <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">the_on</span> = <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">help_requested_on</span>
23
+ <span class="ruby-identifier">show_individual_extended_help</span>(<span class="ruby-identifier">the_on</span>.<span class="ruby-identifier">to_sym</span>)
24
+ <span class="ruby-keyword kw">end</span>
25
+ <span class="ruby-identifier">exit</span>
26
+ <span class="ruby-keyword kw">end</span>
27
+ <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">extended_help_requested?</span>
28
+ <span class="ruby-identifier">show_extended_help</span>
29
+ <span class="ruby-identifier">exit</span>
30
+ <span class="ruby-keyword kw">end</span>
31
+ <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">errors?</span>
32
+ <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">divulge_problems</span>
33
+ <span class="ruby-identifier">show_help</span>
34
+ <span class="ruby-identifier">exit</span>
35
+ <span class="ruby-keyword kw">end</span>
36
+ <span class="ruby-keyword kw">if</span> <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">warnings?</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">level</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:with_no_warnings</span>
37
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;In strict warning handling mode. Warnings will cause process to exit.&quot;</span>
38
+ <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">warnings</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span>
39
+ <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot; #{ x }&quot;</span>
40
+ <span class="ruby-keyword kw">end</span>
41
+ <span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;Please fix these warnings and try again.&quot;</span>
42
+ <span class="ruby-identifier">exit</span>
43
+ <span class="ruby-keyword kw">end</span>
44
+ <span class="ruby-comment cmt"># the next three lines augment the </span>
45
+ <span class="ruby-comment cmt"># name of the module that the user</span>
46
+ <span class="ruby-comment cmt"># has declared... not just ARGV.</span>
47
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">extend</span> <span class="ruby-constant">NewInterface</span>
48
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">flag_value</span> = <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">flag_value</span>
49
+ <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">errors</span> = <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">errors</span>
50
+ <span class="ruby-constant">ARGV</span>
51
+ <span class="ruby-keyword kw">end</span></pre>
52
+ </body>
53
+ </html>