Sha256: 5cdbbde8e0b647213f7543956ed503be724d9d2606b786c413b352dbb7bbff47

Contents?: true

Size: 499 Bytes

Versions: 121

Compression:

Stored size: 499 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
end

Version data entries

121 entries across 121 versions & 1 rubygems

Version Path
rbbt-util-5.13.37 share/rbbt_commands/tsv/get
rbbt-util-5.13.36 share/rbbt_commands/tsv/get
rbbt-util-5.13.35 share/rbbt_commands/tsv/get
rbbt-util-5.13.34 share/rbbt_commands/tsv/get
rbbt-util-5.13.33 share/rbbt_commands/tsv/get
rbbt-util-5.13.32 share/rbbt_commands/tsv/get
rbbt-util-5.13.31 share/rbbt_commands/tsv/get
rbbt-util-5.13.30 share/rbbt_commands/tsv/get
rbbt-util-5.13.29 share/rbbt_commands/tsv/get
rbbt-util-5.13.28 share/rbbt_commands/tsv/get
rbbt-util-5.13.27 share/rbbt_commands/tsv/get
rbbt-util-5.13.26 share/rbbt_commands/tsv/get
rbbt-util-5.13.25 share/rbbt_commands/tsv/get
rbbt-util-5.13.24 share/rbbt_commands/tsv/get
rbbt-util-5.13.23 share/rbbt_commands/tsv/get
rbbt-util-5.13.22 share/rbbt_commands/tsv/get
rbbt-util-5.13.21 share/rbbt_commands/tsv/get
rbbt-util-5.13.20 share/rbbt_commands/tsv/get
rbbt-util-5.13.19 share/rbbt_commands/tsv/get
rbbt-util-5.13.18 share/rbbt_commands/tsv/get