Revision c3024b7e htools/Ganeti/HTools/Utils.hs

b/htools/Ganeti/HTools/Utils.hs
33 33
  , commaJoin
34 34
  , tryRead
35 35
  , formatTable
36
  , printTable
36 37
  , parseUnit
37 38
  , plural
38 39
  ) where
......
156 157
                    ) (zip3 vtrans numpos mlens)
157 158
   in transpose expnd
158 159

  
160
-- | Constructs a printable table from given header and rows
161
printTable :: String -> [String] -> [[String]] -> [Bool] -> String
162
printTable lp header rows isnum =
163
  unlines . map ((++) lp) . map ((:) ' ' . unwords) $
164
  formatTable (header:rows) isnum
165

  
159 166
-- | Tries to extract number and scale from the given string.
160 167
--
161 168
-- Input must be in the format NUMBER+ SPACE* [UNIT]. If no unit is

Also available in: Unified diff