Sha256: 8360ea28e9fc5851c84abfb62fe964f8dc93addce5be15526cbeeba94883ce68

Contents?: true

Size: 494 Bytes

Versions: 276

Compression:

Stored size: 494 Bytes

Contents

#!/usr/bin/env ruby

require 'rbbt-util'
require 'rbbt/util/simpleopt'

options = SOPT.get("-tch--tokyocabinet:-tcb--tokyocabinet_bd")

file = ARGV.shift
value = ARGV.shift

case
when options[:tokyocabinet]
  tsv = Persist.open_tokyocabinet(file, false)
when options[:tokyocabinet_bd]
  tsv = Persist.open_tokyocabinet(file, false, nil, TokyoCabinet::BDB)
else
  tsv = TSV.open(file, :grep => value )
end

res = tsv[value]

if res.nil?
  raise "RECORD NOT FOUND"
else
  puts tsv[value].report

Version data entries

276 entries across 276 versions & 1 rubygems

Version Path
rbbt-util-5.21.23 share/rbbt_commands/tsv/get
rbbt-util-5.21.22 share/rbbt_commands/tsv/get
rbbt-util-5.21.21 share/rbbt_commands/tsv/get
rbbt-util-5.21.20 share/rbbt_commands/tsv/get
rbbt-util-5.21.19 share/rbbt_commands/tsv/get
rbbt-util-5.21.17 share/rbbt_commands/tsv/get
rbbt-util-5.21.16 share/rbbt_commands/tsv/get
rbbt-util-5.21.14 share/rbbt_commands/tsv/get
rbbt-util-5.21.13 share/rbbt_commands/tsv/get
rbbt-util-5.21.12 share/rbbt_commands/tsv/get
rbbt-util-5.21.11 share/rbbt_commands/tsv/get
rbbt-util-5.21.9 share/rbbt_commands/tsv/get
rbbt-util-5.21.8 share/rbbt_commands/tsv/get
rbbt-util-5.21.7 share/rbbt_commands/tsv/get
rbbt-util-5.21.6 share/rbbt_commands/tsv/get
rbbt-util-5.21.5 share/rbbt_commands/tsv/get
rbbt-util-5.21.4 share/rbbt_commands/tsv/get
rbbt-util-5.21.3 share/rbbt_commands/tsv/get
rbbt-util-5.21.2 share/rbbt_commands/tsv/get
rbbt-util-5.21.1 share/rbbt_commands/tsv/get