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.12.1 share/rbbt_commands/tsv/get
rbbt-util-5.12.0 share/rbbt_commands/tsv/get
rbbt-util-5.11.9 share/rbbt_commands/tsv/get
rbbt-util-5.11.8 share/rbbt_commands/tsv/get
rbbt-util-5.11.7 share/rbbt_commands/tsv/get
rbbt-util-5.11.6 share/rbbt_commands/tsv/get
rbbt-util-5.11.5 share/rbbt_commands/tsv/get
rbbt-util-5.11.4 share/rbbt_commands/tsv/get
rbbt-util-5.11.3 share/rbbt_commands/tsv/get
rbbt-util-5.11.2 share/rbbt_commands/tsv/get
rbbt-util-5.11.1 share/rbbt_commands/tsv/get
rbbt-util-5.10.2 share/rbbt_commands/tsv/get
rbbt-util-5.10.1 share/rbbt_commands/tsv/get
rbbt-util-5.9.12 share/rbbt_commands/tsv/get
rbbt-util-5.9.11 share/rbbt_commands/tsv/get
rbbt-util-5.9.10 share/rbbt_commands/tsv/get
rbbt-util-5.9.8 share/rbbt_commands/tsv/get
rbbt-util-5.9.7 share/rbbt_commands/tsv/get
rbbt-util-5.9.6 share/rbbt_commands/tsv/get
rbbt-util-5.9.5 share/rbbt_commands/tsv/get