optiflag 0.6 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- data/ReleaseNotes.txt +35 -0
- data/doc/classes/OptiFlag.html +439 -0
- data/doc/classes/OptiFlag.src/M000001.html +49 -0
- data/doc/classes/OptiFlag.src/M000002.html +49 -0
- data/doc/classes/OptiFlag.src/M000003.html +30 -0
- data/doc/classes/OptiFlag/Flagset.html +459 -0
- data/doc/classes/OptiFlag/Flagset.src/M000003.html +45 -0
- data/doc/classes/OptiFlag/Flagset.src/M000004.html +45 -0
- data/doc/classes/OptiFlag/Flagset.src/M000005.html +18 -0
- data/doc/classes/OptiFlag/Flagset.src/M000006.html +20 -0
- data/doc/classes/OptiFlag/Flagset.src/M000007.html +35 -0
- data/doc/classes/OptiFlag/Flagset.src/M000008.html +23 -0
- data/doc/classes/OptiFlag/Flagset.src/M000009.html +24 -0
- data/doc/classes/OptiFlag/Flagset.src/M000010.html +28 -0
- data/doc/classes/OptiFlag/Flagset.src/M000011.html +20 -0
- data/doc/classes/OptiFlag/Flagset.src/M000012.html +24 -0
- data/doc/classes/OptiFlag/Flagset.src/M000013.html +24 -0
- data/doc/classes/OptiFlag/Flagset.src/M000014.html +32 -0
- data/doc/classes/OptiFlag/Flagset.src/M000015.html +25 -0
- data/doc/classes/OptiFlag/Flagset.src/M000016.html +53 -0
- data/doc/classes/OptiFlag/Flagset.src/M000017.html +53 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.html +930 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000024.html +36 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000025.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000026.html +36 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000027.html +36 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000028.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000029.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000030.html +19 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000031.html +19 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000032.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000033.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000034.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000035.html +22 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000036.html +19 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000037.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000038.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000039.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000040.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000041.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000042.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000043.html +19 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000044.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000045.html +19 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000046.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000047.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000048.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000049.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000050.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000051.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000052.html +20 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000053.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000054.html +18 -0
- data/doc/classes/OptiFlag/Flagset/EachFlag.src/M000055.html +22 -0
- data/doc/classes/OptiFlag/Flagset/Errors.html +192 -0
- data/doc/classes/OptiFlag/Flagset/Errors.src/M000021.html +18 -0
- data/doc/classes/OptiFlag/Flagset/Errors.src/M000022.html +19 -0
- data/doc/classes/OptiFlag/Flagset/Errors.src/M000023.html +18 -0
- data/doc/classes/OptiFlag/Flagset/Errors.src/M000024.html +18 -0
- data/doc/classes/OptiFlag/Flagset/Errors.src/M000025.html +19 -0
- data/doc/classes/OptiFlag/Flagset/Errors.src/M000026.html +36 -0
- data/doc/classes/OptiFlag/Flagset/Help.html +125 -0
- data/doc/classes/OptiFlag/Flagset/Help/Bundle.html +160 -0
- data/doc/classes/OptiFlag/Flagset/Help/Bundle.src/M000018.html +18 -0
- data/doc/classes/OptiFlag/Flagset/Help/Bundle.src/M000019.html +18 -0
- data/doc/classes/OptiFlag/Flagset/Help/StandardHelpBundle.html +118 -0
- data/doc/classes/OptiFlag/Flagset/NewInterface.html +296 -0
- data/doc/classes/OptiFlag/Flagset/NewInterface.src/M000017.html +18 -0
- data/doc/classes/OptiFlag/Flagset/NewInterface.src/M000018.html +18 -0
- data/doc/classes/OptiFlag/Flagset/NewInterface.src/M000019.html +18 -0
- data/doc/classes/OptiFlag/Flagset/NewInterface.src/M000020.html +18 -0
- data/doc/classes/OptiFlag/Flagset/NewInterface.src/M000021.html +18 -0
- data/doc/classes/OptiFlag/Flagset/NewInterface.src/M000022.html +18 -0
- data/doc/classes/OptiFlag/Flagset/NewInterface.src/M000023.html +18 -0
- data/doc/created.rid +1 -0
- data/doc/files/optiflag-help_rb.html +101 -0
- data/doc/files/optiflag-parse_rb.html +101 -0
- data/doc/files/optiflag_rb.html +167 -0
- data/doc/files/optiflag_rb.src/M000001.html +18 -0
- data/doc/fr_class_index.html +34 -0
- data/doc/fr_file_index.html +29 -0
- data/doc/fr_method_index.html +82 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/examples/example_1.rb +21 -0
- data/examples/example_1_1.rb +21 -0
- data/{doc/example → examples}/example_1_2.rb +8 -8
- data/examples/example_2.rb +31 -0
- data/{doc/example → examples}/example_2_1.rb +4 -4
- data/{doc/example → examples}/example_2_2.rb +7 -5
- data/{doc/example → examples}/example_2_3.rb +9 -9
- data/{doc/example → examples}/example_2_4.rb +4 -4
- data/{doc/example → examples}/example_2_5.rb +4 -4
- data/{doc/example → examples}/example_2_6.rb +6 -6
- data/{doc/example → examples}/example_3.rb +7 -6
- data/examples/example_6.rb +20 -0
- data/{doc/example → examples}/example_7.rb +5 -4
- data/examples/example_8.rb +26 -0
- data/optiflag-help.rb +42 -0
- data/optiflag-parse.rb +281 -0
- data/optiflag.gemspec +4 -3
- data/optiflag.rb +972 -0
- data/quick.rb +12 -0
- data/{test → testcases}/tc_advanced_usage_helping.rb +4 -0
- data/{test → testcases}/tc_basic_alternate_forms.rb +0 -0
- data/{test → testcases}/tc_basic_char_flags.rb +12 -12
- data/{test → testcases}/tc_basic_optional_flag.rb +0 -0
- data/{test → testcases}/tc_basic_parsing.rb +0 -0
- data/{test → testcases}/tc_basic_usage_helping.rb +0 -0
- data/{test → testcases}/tc_basic_value_validation.rb +0 -0
- data/{test → testcases}/tc_bug_one.rb +0 -0
- data/{test → testcases}/tc_bug_two.rb +0 -0
- data/{test → testcases}/tc_change_symbols.rb +0 -0
- data/{test → testcases}/tc_enumerated_value_validation.rb +0 -0
- data/{test → testcases}/tc_flagall.rb +4 -0
- data/{test → testcases}/tc_flagless_arg.rb +0 -0
- data/{test → testcases}/tc_keyword.rb +0 -0
- data/testcases/tc_new_basic_parsing.rb +51 -0
- data/testcases/tc_poro_tester.rb +30 -0
- data/{test → testcases}/tc_values_as_hash.rb +0 -0
- metadata +152 -52
- data/doc/example/example_1.rb +0 -30
- data/doc/example/example_1_1.rb +0 -27
- data/doc/example/example_2.rb +0 -28
- data/doc/example/example_4.rb +0 -12
- data/doc/example/example_5.rb +0 -26
- data/doc/example/example_6.rb +0 -17
- data/lib/optiflag.rb +0 -860
data/quick.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'optiflag'
|
2
|
+
|
3
|
+
module DBChecker extend OptiFlagSet(:flag_symbol => "/")
|
4
|
+
flag "log"
|
5
|
+
flag "password"
|
6
|
+
flag "user"
|
7
|
+
|
8
|
+
and_process!
|
9
|
+
end
|
10
|
+
puts "The user's user name is #{ DBChecker.flags.user }"
|
11
|
+
puts "The user's password is #{ DBChecker.flags.password }"
|
12
|
+
puts "The log directory is #{ DBChecker.flags.log }"
|
@@ -24,6 +24,8 @@ class TC_AdvancedHelpArgs < Test::Unit::TestCase
|
|
24
24
|
"thedire is the proper value of the dir flag")
|
25
25
|
end
|
26
26
|
end
|
27
|
+
|
28
|
+
# added a dummy comment
|
27
29
|
def test_no_help_requested
|
28
30
|
command_lines =
|
29
31
|
["-dir thedire",
|
@@ -40,3 +42,5 @@ class TC_AdvancedHelpArgs < Test::Unit::TestCase
|
|
40
42
|
end
|
41
43
|
end
|
42
44
|
end
|
45
|
+
|
46
|
+
|
File without changes
|
@@ -31,11 +31,11 @@ class TC_CharArgs < Test::Unit::TestCase
|
|
31
31
|
command_lines.each do |x|
|
32
32
|
argv = x.split
|
33
33
|
args = CharArgs::parse(argv)
|
34
|
-
assert_equal(true,args.
|
34
|
+
assert_equal(true,args.flags.f?,
|
35
35
|
"The 'f' flag should be set")
|
36
|
-
assert_equal(true,args.
|
36
|
+
assert_equal(true,args.flags.v?,
|
37
37
|
"The 'v' flag should be set")
|
38
|
-
assert_equal(true,args.
|
38
|
+
assert_equal(true,args.flags.x?,
|
39
39
|
"The 'x' flag should be set")
|
40
40
|
|
41
41
|
end
|
@@ -54,9 +54,9 @@ class TC_CharArgs < Test::Unit::TestCase
|
|
54
54
|
command_lines.each do |x|
|
55
55
|
argv = x.split
|
56
56
|
args = CharArgs::parse(argv)
|
57
|
-
assert_equal(false,args.
|
58
|
-
assert_equal(false,args.
|
59
|
-
assert_equal(false,args.
|
57
|
+
assert_equal(false,args.flags.l?)
|
58
|
+
assert_equal(false,args.flags.s?)
|
59
|
+
assert_equal(false,args.flags.a?)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
def test_lsa_not_there
|
@@ -87,12 +87,12 @@ class TC_CharArgs < Test::Unit::TestCase
|
|
87
87
|
command_lines.each do |x|
|
88
88
|
argv = x.split
|
89
89
|
args = CharArgs::parse(argv)
|
90
|
-
assert_equal(true,args.
|
91
|
-
assert_equal(true,args.
|
92
|
-
assert_equal(true,args.
|
93
|
-
assert_equal(false,args.
|
94
|
-
assert_equal(false,args.
|
95
|
-
assert_equal(false,args.
|
90
|
+
assert_equal(true,args.flags.l?)
|
91
|
+
assert_equal(true,args.flags.s?)
|
92
|
+
assert_equal(true,args.flags.a?)
|
93
|
+
assert_equal(false,args.flags.x?)
|
94
|
+
assert_equal(false,args.flags.v?)
|
95
|
+
assert_equal(false,args.flags.f?)
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,4 +1,6 @@
|
|
1
1
|
require 'test/unit'
|
2
|
+
$: << ".." # to find optiflag
|
3
|
+
|
2
4
|
|
3
5
|
require 'tc_basic_parsing.rb'
|
4
6
|
require 'tc_basic_value_validation.rb'
|
@@ -14,4 +16,6 @@ require 'tc_bug_two.rb'
|
|
14
16
|
require 'tc_basic_char_flags.rb'
|
15
17
|
require 'tc_keyword.rb'
|
16
18
|
require 'tc_values_as_hash.rb'
|
19
|
+
require 'tc_poro_tester.rb'
|
17
20
|
|
21
|
+
require 'tc_new_basic_parsing.rb'
|
File without changes
|
File without changes
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'optiflag.rb'
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
module DansArgs extend OptiFlagSet
|
5
|
+
flag "directory"
|
6
|
+
flag "script"
|
7
|
+
flag "control_db" do
|
8
|
+
description "The control database credentials"
|
9
|
+
end
|
10
|
+
flag "target_db"
|
11
|
+
end
|
12
|
+
|
13
|
+
class TC_NewFlagAll < Test::Unit::TestCase
|
14
|
+
|
15
|
+
def setup
|
16
|
+
@regular_dans_args = %w{-directory my_directory -script my_script
|
17
|
+
-control_db control -target_db target}
|
18
|
+
@missing_dans_args = %w{-directory my_directory -script my_script}
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_regular_dans_arg_parses
|
22
|
+
DansArgs::and_process!({:argv => @regular_dans_args})
|
23
|
+
assert_equal("my_directory",DansArgs.flags.directory,
|
24
|
+
"Flag should be equal to my_directory")
|
25
|
+
assert(DansArgs.flags.directory?,
|
26
|
+
"Directory Flag should have been passed")
|
27
|
+
assert_equal("my_script",DansArgs.flags.script,
|
28
|
+
"Flag should be equal to my_script")
|
29
|
+
assert_equal("control",DansArgs.flags.control_db,
|
30
|
+
"Flag should be equal to control")
|
31
|
+
assert(DansArgs.errors? == false,"There should be no errors")
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_missing_dans_arg_parses
|
35
|
+
result = DansArgs::parse(@missing_dans_args)
|
36
|
+
assert( result.errors?,
|
37
|
+
"There should be errors, with two missing required options")
|
38
|
+
assert_equal("-control_db",result.errors.missing_flags[0],
|
39
|
+
"First Missing flag should be -control_db")
|
40
|
+
assert_equal("-target_db",result.errors.missing_flags[1],
|
41
|
+
"Second Missing flag should be -target_db")
|
42
|
+
assert_equal(2,result.errors.missing_flags.length,
|
43
|
+
"There should be two missing flags")
|
44
|
+
end
|
45
|
+
|
46
|
+
def teardown
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'optiflag.rb'
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
class Person
|
5
|
+
attr_accessor :name,:ssn
|
6
|
+
end
|
7
|
+
class Employee < Person
|
8
|
+
attr_accessor :username,:password
|
9
|
+
end
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
class TC_PORO < Test::Unit::TestCase
|
15
|
+
|
16
|
+
|
17
|
+
def test_PORO
|
18
|
+
daniel = Employee.new
|
19
|
+
cl = " -username doeklund -password AHA -ssn 1234562342 -name DanielEklund"
|
20
|
+
ARGV.clear
|
21
|
+
cl.split.each{|x| ARGV << x}
|
22
|
+
OptiFlag.using_object(daniel)
|
23
|
+
assert(daniel.username == "doeklund")
|
24
|
+
assert(daniel.password == "AHA")
|
25
|
+
assert(daniel.ssn == "1234562342")
|
26
|
+
assert(daniel.name == "DanielEklund")
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
File without changes
|
metadata
CHANGED
@@ -3,11 +3,11 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: optiflag
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version:
|
7
|
-
date:
|
8
|
-
summary:
|
6
|
+
version: 0.6.5
|
7
|
+
date: 2007-04-16 00:00:00 -04:00
|
8
|
+
summary: OptiFlag is an embeddable DSL library for declaring and using command-line options/flags in any Ruby program.
|
9
9
|
require_paths:
|
10
|
-
-
|
10
|
+
- .
|
11
11
|
email: doeklund@gmail.com
|
12
12
|
homepage: http://rubyforge.org/projects/optiflag/
|
13
13
|
rubyforge_project: optiflag
|
@@ -30,57 +30,157 @@ authors:
|
|
30
30
|
- Daniel Eklund
|
31
31
|
files:
|
32
32
|
- doc
|
33
|
-
-
|
33
|
+
- examples
|
34
|
+
- optiflag-help.rb
|
35
|
+
- optiflag-parse.rb
|
34
36
|
- optiflag.gemspec
|
37
|
+
- optiflag.rb
|
38
|
+
- quick.rb
|
35
39
|
- ReleaseNotes.txt
|
36
|
-
-
|
37
|
-
- doc/
|
38
|
-
- doc/
|
39
|
-
- doc/
|
40
|
-
- doc/
|
41
|
-
- doc/
|
42
|
-
- doc/
|
43
|
-
- doc/
|
44
|
-
- doc/
|
45
|
-
- doc/
|
46
|
-
- doc/
|
47
|
-
- doc/
|
48
|
-
- doc/
|
49
|
-
- doc/
|
50
|
-
- doc/
|
51
|
-
- doc/
|
52
|
-
- doc/
|
53
|
-
-
|
54
|
-
-
|
55
|
-
-
|
56
|
-
-
|
57
|
-
-
|
58
|
-
-
|
59
|
-
-
|
60
|
-
-
|
61
|
-
-
|
62
|
-
-
|
63
|
-
-
|
64
|
-
-
|
65
|
-
-
|
66
|
-
-
|
67
|
-
-
|
68
|
-
-
|
40
|
+
- testcases
|
41
|
+
- doc/classes
|
42
|
+
- doc/created.rid
|
43
|
+
- doc/files
|
44
|
+
- doc/fr_class_index.html
|
45
|
+
- doc/fr_file_index.html
|
46
|
+
- doc/fr_method_index.html
|
47
|
+
- doc/index.html
|
48
|
+
- doc/rdoc-style.css
|
49
|
+
- doc/classes/OptiFlag
|
50
|
+
- doc/classes/OptiFlag.html
|
51
|
+
- doc/classes/OptiFlag.src
|
52
|
+
- doc/classes/OptiFlag/Flagset
|
53
|
+
- doc/classes/OptiFlag/Flagset.html
|
54
|
+
- doc/classes/OptiFlag/Flagset.src
|
55
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.html
|
56
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src
|
57
|
+
- doc/classes/OptiFlag/Flagset/Errors.html
|
58
|
+
- doc/classes/OptiFlag/Flagset/Errors.src
|
59
|
+
- doc/classes/OptiFlag/Flagset/Help
|
60
|
+
- doc/classes/OptiFlag/Flagset/Help.html
|
61
|
+
- doc/classes/OptiFlag/Flagset/NewInterface.html
|
62
|
+
- doc/classes/OptiFlag/Flagset/NewInterface.src
|
63
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000024.html
|
64
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000025.html
|
65
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000026.html
|
66
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000027.html
|
67
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000028.html
|
68
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000029.html
|
69
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000030.html
|
70
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000031.html
|
71
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000032.html
|
72
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000033.html
|
73
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000034.html
|
74
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000035.html
|
75
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000036.html
|
76
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000037.html
|
77
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000038.html
|
78
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000039.html
|
79
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000040.html
|
80
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000041.html
|
81
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000042.html
|
82
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000043.html
|
83
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000044.html
|
84
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000045.html
|
85
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000046.html
|
86
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000047.html
|
87
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000048.html
|
88
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000049.html
|
89
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000050.html
|
90
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000051.html
|
91
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000052.html
|
92
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000053.html
|
93
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000054.html
|
94
|
+
- doc/classes/OptiFlag/Flagset/EachFlag.src/M000055.html
|
95
|
+
- doc/classes/OptiFlag/Flagset/Errors.src/M000021.html
|
96
|
+
- doc/classes/OptiFlag/Flagset/Errors.src/M000022.html
|
97
|
+
- doc/classes/OptiFlag/Flagset/Errors.src/M000023.html
|
98
|
+
- doc/classes/OptiFlag/Flagset/Errors.src/M000024.html
|
99
|
+
- doc/classes/OptiFlag/Flagset/Errors.src/M000025.html
|
100
|
+
- doc/classes/OptiFlag/Flagset/Errors.src/M000026.html
|
101
|
+
- doc/classes/OptiFlag/Flagset/Help/Bundle.html
|
102
|
+
- doc/classes/OptiFlag/Flagset/Help/Bundle.src
|
103
|
+
- doc/classes/OptiFlag/Flagset/Help/StandardHelpBundle.html
|
104
|
+
- doc/classes/OptiFlag/Flagset/Help/Bundle.src/M000018.html
|
105
|
+
- doc/classes/OptiFlag/Flagset/Help/Bundle.src/M000019.html
|
106
|
+
- doc/classes/OptiFlag/Flagset/NewInterface.src/M000017.html
|
107
|
+
- doc/classes/OptiFlag/Flagset/NewInterface.src/M000018.html
|
108
|
+
- doc/classes/OptiFlag/Flagset/NewInterface.src/M000019.html
|
109
|
+
- doc/classes/OptiFlag/Flagset/NewInterface.src/M000020.html
|
110
|
+
- doc/classes/OptiFlag/Flagset/NewInterface.src/M000021.html
|
111
|
+
- doc/classes/OptiFlag/Flagset/NewInterface.src/M000022.html
|
112
|
+
- doc/classes/OptiFlag/Flagset/NewInterface.src/M000023.html
|
113
|
+
- doc/classes/OptiFlag/Flagset.src/M000003.html
|
114
|
+
- doc/classes/OptiFlag/Flagset.src/M000004.html
|
115
|
+
- doc/classes/OptiFlag/Flagset.src/M000005.html
|
116
|
+
- doc/classes/OptiFlag/Flagset.src/M000006.html
|
117
|
+
- doc/classes/OptiFlag/Flagset.src/M000007.html
|
118
|
+
- doc/classes/OptiFlag/Flagset.src/M000008.html
|
119
|
+
- doc/classes/OptiFlag/Flagset.src/M000009.html
|
120
|
+
- doc/classes/OptiFlag/Flagset.src/M000010.html
|
121
|
+
- doc/classes/OptiFlag/Flagset.src/M000011.html
|
122
|
+
- doc/classes/OptiFlag/Flagset.src/M000012.html
|
123
|
+
- doc/classes/OptiFlag/Flagset.src/M000013.html
|
124
|
+
- doc/classes/OptiFlag/Flagset.src/M000014.html
|
125
|
+
- doc/classes/OptiFlag/Flagset.src/M000015.html
|
126
|
+
- doc/classes/OptiFlag/Flagset.src/M000016.html
|
127
|
+
- doc/classes/OptiFlag/Flagset.src/M000017.html
|
128
|
+
- doc/classes/OptiFlag.src/M000001.html
|
129
|
+
- doc/classes/OptiFlag.src/M000002.html
|
130
|
+
- doc/classes/OptiFlag.src/M000003.html
|
131
|
+
- doc/files/optiflag-help_rb.html
|
132
|
+
- doc/files/optiflag-parse_rb.html
|
133
|
+
- doc/files/optiflag_rb.html
|
134
|
+
- doc/files/optiflag_rb.src
|
135
|
+
- doc/files/optiflag_rb.src/M000001.html
|
136
|
+
- examples/example_1.rb
|
137
|
+
- examples/example_1_1.rb
|
138
|
+
- examples/example_1_2.rb
|
139
|
+
- examples/example_2.rb
|
140
|
+
- examples/example_2_1.rb
|
141
|
+
- examples/example_2_2.rb
|
142
|
+
- examples/example_2_3.rb
|
143
|
+
- examples/example_2_4.rb
|
144
|
+
- examples/example_2_5.rb
|
145
|
+
- examples/example_2_6.rb
|
146
|
+
- examples/example_3.rb
|
147
|
+
- examples/example_6.rb
|
148
|
+
- examples/example_7.rb
|
149
|
+
- examples/example_8.rb
|
150
|
+
- testcases/tc_advanced_usage_helping.rb
|
151
|
+
- testcases/tc_basic_alternate_forms.rb
|
152
|
+
- testcases/tc_basic_char_flags.rb
|
153
|
+
- testcases/tc_basic_optional_flag.rb
|
154
|
+
- testcases/tc_basic_parsing.rb
|
155
|
+
- testcases/tc_basic_usage_helping.rb
|
156
|
+
- testcases/tc_basic_value_validation.rb
|
157
|
+
- testcases/tc_bug_one.rb
|
158
|
+
- testcases/tc_bug_two.rb
|
159
|
+
- testcases/tc_change_symbols.rb
|
160
|
+
- testcases/tc_enumerated_value_validation.rb
|
161
|
+
- testcases/tc_flagall.rb
|
162
|
+
- testcases/tc_flagless_arg.rb
|
163
|
+
- testcases/tc_keyword.rb
|
164
|
+
- testcases/tc_new_basic_parsing.rb
|
165
|
+
- testcases/tc_poro_tester.rb
|
166
|
+
- testcases/tc_values_as_hash.rb
|
69
167
|
test_files:
|
70
|
-
-
|
71
|
-
-
|
72
|
-
-
|
73
|
-
-
|
74
|
-
-
|
75
|
-
-
|
76
|
-
-
|
77
|
-
-
|
78
|
-
-
|
79
|
-
-
|
80
|
-
-
|
81
|
-
-
|
82
|
-
-
|
83
|
-
-
|
168
|
+
- testcases/tc_advanced_usage_helping.rb
|
169
|
+
- testcases/tc_basic_alternate_forms.rb
|
170
|
+
- testcases/tc_basic_char_flags.rb
|
171
|
+
- testcases/tc_basic_optional_flag.rb
|
172
|
+
- testcases/tc_basic_parsing.rb
|
173
|
+
- testcases/tc_basic_usage_helping.rb
|
174
|
+
- testcases/tc_basic_value_validation.rb
|
175
|
+
- testcases/tc_bug_one.rb
|
176
|
+
- testcases/tc_bug_two.rb
|
177
|
+
- testcases/tc_change_symbols.rb
|
178
|
+
- testcases/tc_enumerated_value_validation.rb
|
179
|
+
- testcases/tc_flagless_arg.rb
|
180
|
+
- testcases/tc_keyword.rb
|
181
|
+
- testcases/tc_new_basic_parsing.rb
|
182
|
+
- testcases/tc_poro_tester.rb
|
183
|
+
- testcases/tc_values_as_hash.rb
|
84
184
|
rdoc_options: []
|
85
185
|
|
86
186
|
extra_rdoc_files: []
|
data/doc/example/example_1.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'optiflag'
|
2
|
-
|
3
|
-
# Example 1: Four required flags
|
4
|
-
module Example extend OptiFlag::Flagset
|
5
|
-
flag "dir"
|
6
|
-
flag "log"
|
7
|
-
flag "username"
|
8
|
-
flag "password"
|
9
|
-
end
|
10
|
-
|
11
|
-
result = Example::parse(ARGV)
|
12
|
-
if result.errors?
|
13
|
-
result.errors.divulge_problems
|
14
|
-
exit
|
15
|
-
end
|
16
|
-
|
17
|
-
# Some code to _use_ the values
|
18
|
-
puts "User has input:#{ result.flag_value.dir } for dir"
|
19
|
-
puts "User has input:#{ result.flag_value.log } for log"
|
20
|
-
puts "User has input:#{ result.flag_value.username } for username"
|
21
|
-
puts "User has input:#{ result.flag_value.password } for password"
|
22
|
-
|
23
|
-
puts "The variable 'result' is actually just a copy of ARGV"
|
24
|
-
puts "that has been extend to hold the return variables:"
|
25
|
-
puts "See: #{ result.join(', ') }"
|
26
|
-
|
27
|
-
|
28
|
-
# Try the following inputs
|
29
|
-
# ruby example_1.rb
|
30
|
-
#h# ruby example_1.rb -log logdirectory -dir directory -username me -password fluffy
|