mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
Bug #1344: Handle CLI output of many lines to a pipe
This commit is contained in:
parent
a3988c2150
commit
e9693f8c93
@ -168,13 +168,18 @@ module CLIHelper
|
||||
def print_data(data, options)
|
||||
ncolumns=@default_columns.length
|
||||
res_data=data_array(data, options)
|
||||
print res_data.collect{|l|
|
||||
(0..ncolumns-1).collect{ |i|
|
||||
dat=l[i]
|
||||
col=@default_columns[i]
|
||||
format_str(col, dat)
|
||||
}.join(' ')
|
||||
}.join("\n")
|
||||
|
||||
begin
|
||||
print res_data.collect{|l|
|
||||
(0..ncolumns-1).collect{ |i|
|
||||
dat=l[i]
|
||||
col=@default_columns[i]
|
||||
format_str(col, dat)
|
||||
}.join(' ')
|
||||
}.join("\n")
|
||||
rescue Errno::EPIPE
|
||||
end
|
||||
|
||||
puts
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user