coulis 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/coulis.rb +1 -1
- data/test/coulis_test.rb +6 -0
- metadata +2 -2
data/lib/coulis.rb
CHANGED
@@ -34,7 +34,7 @@ class Coulis
|
|
34
34
|
definition.call
|
35
35
|
else
|
36
36
|
arg_name = "#{"-" if m[0..0] != "-"}#{m}"
|
37
|
-
arg_name = "-" + arg_name if arg_name.size > 2
|
37
|
+
arg_name = "-" + arg_name.gsub("_", "-") if arg_name.size > 2
|
38
38
|
|
39
39
|
if args.to_s.empty?
|
40
40
|
@args << [ definition || arg_name ]
|
data/test/coulis_test.rb
CHANGED
@@ -70,6 +70,12 @@ class SimpleCliTest < Test::Unit::TestCase
|
|
70
70
|
assert_equal ls.args.to_s, "--color"
|
71
71
|
end
|
72
72
|
|
73
|
+
def test_not_defined_long_argument_with_underscore
|
74
|
+
ls = Ls.options { color_test }
|
75
|
+
assert_equal ls.args.size, 1
|
76
|
+
assert_equal ls.args.to_s, "--color-test"
|
77
|
+
end
|
78
|
+
|
73
79
|
def test_command
|
74
80
|
assert_equal Ls.options { full; s }.command, "ls -a -h -s"
|
75
81
|
end
|