rbbt-util 5.6.4 → 5.6.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c71dfbcf2b547eae0ab59b0fcf3b590d08668244
4
- data.tar.gz: 27f56badaca1455685f00466bce558785ed357a8
3
+ metadata.gz: 6a46ea266ad3643e792d4ada78b8fc6481cb0402
4
+ data.tar.gz: f0d162717d49d90ed84fcf3a470970463210db11
5
5
  SHA512:
6
- metadata.gz: 7a5fefc16d333e8ba239800eee76e90f3ae4d76efbcd50629c1ebd5cbab030f1f94aacba342336fab7bb12dc835ea1317ba1fcb1505e54e872ce0260afd9953c
7
- data.tar.gz: 44dcbc2f220861724f3de420d7e6f6c65676893365b3d4c99391d0928b0ae12816db168b181af0e1349d35dc4441237687331f2f55febb459503ea928d8dfe95
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) << "\n"
67
- str << " " << description << "\n" if description and not description.empty?
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
- next_letter = chars.shift
12
- return nil if next_letter.nil?
13
- current << next_letter
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
 
@@ -9,6 +9,8 @@ file = ARGV.shift
9
9
 
10
10
  file = STDIN if file == '-'
11
11
 
12
+ raise ParameterException, "Please specify the tsv file as argument" if file.nil?
13
+
12
14
  case
13
15
  when options[:tokyocabinet]
14
16
  tsv = Persist.open_tokyocabinet(file, false)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.4
4
+ version: 5.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez