From 58e53ba41aed48d4c36909f461ede885dbba2e34 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Wed, 9 Jul 2008 21:29:46 +0000 Subject: [PATCH] HBASE-732 shell formatting error with the describe command git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@675347 13f79535-47bb-0310-9956-ffa450edef68 --- bin/Formatter.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/Formatter.rb b/bin/Formatter.rb index 785afac4f0e..b0be20613c4 100644 --- a/bin/Formatter.rb +++ b/bin/Formatter.rb @@ -77,7 +77,7 @@ module Formatter result = [] index = 0 while index < str.length do - result << str.slice(index, index + width) + result << str.slice(index, width) index += width end result @@ -121,11 +121,13 @@ module Formatter # Do a bit of testing. if $0 == __FILE__ formatter = Console.new(STDOUT) + now = Time.now formatter.header(['a', 'b']) formatter.row(['a', 'b']) formatter.row(['xxxxxxxxx xxxxxxxxxxx xxxxxxxxxxx xxxxxxxxxxxx xxxxxxxxx xxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxx xxxxxxxxxxxxxx']) formatter.row(['yyyyyy yyyyyy yyyyy yyy', 'xxxxxxxxx xxxxxxxxxxx xxxxxxxxxxx xxxxxxxxxxxx xxxxxxxxx xxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxx xxxxxxxxxxxxxx xxx xx x xx xxx xx xx xx x xx x x xxx x x xxx x x xx x x x x x x xx ']) - formatter.footer() + formatter.row(["NAME => 'table1', FAMILIES => [{NAME => 'fam2', VERSIONS => 3, COMPRESSION => 'NONE', IN_MEMORY => false, BLOCKCACHE => false, LENGTH => 2147483647, TTL => FOREVER, BLOOMFILTER => NONE}, {NAME => 'fam1', VERSIONS => 3, COMPRESSION => 'NONE', IN_MEMORY => false, BLOCKCACHE => false, LENGTH => 2147483647, TTL => FOREVER, BLOOMFILTER => NONE}]"]) + formatter.footer(now) end end