rbbt-util 5.6.4 → 5.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/rbbt +8 -1
- data/lib/rbbt/util/simpleopt/doc.rb +2 -2
- data/lib/rbbt/util/simpleopt/parse.rb +11 -3
- data/share/rbbt_commands/tsv/info +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a46ea266ad3643e792d4ada78b8fc6481cb0402
|
4
|
+
data.tar.gz: f0d162717d49d90ed84fcf3a470970463210db11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f94543a04e6919ced4606fe6d58a5211c6f4f84803d6320e99c87fc9a0d28802e8b7ee76011fbe2f5bcbf9bc993fb788ea5cd01f5edc178bddf823de47dc32f
|
7
|
+
data.tar.gz: cca962588cea1323d696ca06d8e4a81e936393cd7f217fc21d3879731276ca080144e21e42b3f1ae8469be61825e4accbd3f94b2baee19d7467583f6fdffb801
|
data/bin/rbbt
CHANGED
@@ -43,6 +43,7 @@ def commands(prev)
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def rbbt_usage(prev = nil)
|
46
|
+
puts
|
46
47
|
puts SOPT.doc
|
47
48
|
|
48
49
|
if prev
|
@@ -58,10 +59,10 @@ def rbbt_usage(prev = nil)
|
|
58
59
|
puts " " << command
|
59
60
|
end
|
60
61
|
end
|
62
|
+
puts
|
61
63
|
end
|
62
64
|
|
63
65
|
def print_error(error, backtrace = nil)
|
64
|
-
puts
|
65
66
|
puts Term::ANSIColor.red("Error:")
|
66
67
|
puts
|
67
68
|
puts error
|
@@ -94,9 +95,15 @@ begin
|
|
94
95
|
exit -1
|
95
96
|
end
|
96
97
|
end
|
98
|
+
|
99
|
+
rbbt_usage(prev)
|
100
|
+
exit 0
|
101
|
+
|
97
102
|
rescue ParameterException
|
103
|
+
puts
|
98
104
|
rbbt_usage
|
99
105
|
print_error($!.message, $!.backtrace)
|
106
|
+
puts
|
100
107
|
exit -1
|
101
108
|
ensure
|
102
109
|
if options[:profile]
|
@@ -63,8 +63,8 @@ module SOPT
|
|
63
63
|
type = :string if type.nil?
|
64
64
|
register(shortcut, name, type, description) unless self.inputs.include? name
|
65
65
|
|
66
|
-
str = " * " << SOPT.input_format(name, type.to_sym, default, shortcut)
|
67
|
-
str << "
|
66
|
+
str = " * " << SOPT.input_format(name, type.to_sym, default, shortcut)
|
67
|
+
str << "\n " << description << "\n" if description and not description.empty?
|
68
68
|
str
|
69
69
|
end * "\n"
|
70
70
|
end
|
@@ -7,10 +7,18 @@ module SOPT
|
|
7
7
|
current = [chars.shift]
|
8
8
|
short = current * ""
|
9
9
|
|
10
|
+
if shortcuts.include? short and long.index "-" or long.index "_"
|
11
|
+
parts = long.split(/[_-]/)
|
12
|
+
acc = parts.collect{|s| s[0] } * ""
|
13
|
+
return acc unless shortcuts.include? acc
|
14
|
+
end
|
15
|
+
|
10
16
|
while shortcuts.include? short
|
11
|
-
|
12
|
-
|
13
|
-
|
17
|
+
while shortcuts[short].index current * ""
|
18
|
+
next_letter = chars.shift
|
19
|
+
return nil if next_letter.nil?
|
20
|
+
current << next_letter
|
21
|
+
end
|
14
22
|
short = current * ""
|
15
23
|
end
|
16
24
|
|