Revision d09b6ed3

b/hbal.1
7 7
.B "[-C]"
8 8
.B "[-p]"
9 9
.B "[-o]"
10
.B "[-v... | -q]"
10 11
.BI "[-l" limit "]"
11 12
.BI "[-O" name... "]"
12 13
.BI "[-e" score "]"
......
295 296
.B -v, --verbose
296 297
Increase the output verbosity. Each usage of this option will increase
297 298
the verbosity (currently more than 2 doesn't make sense) from the
298
default of zero.
299
default of one.
300

  
301
.TP
302
.B -q, --quiet
303
Decrease the output verbosity. Each usage of this option will decrease
304
the verbosity (less than zero doesn't make sense) from the default of
305
one.
299 306

  
300 307
.TP
301 308
.B -V, --version
b/hbal.hs
52 52
 , optInstSet   = False
53 53
 , optMaxLength = -1
54 54
 , optMaster    = ""
55
 , optVerbose   = 0
55
 , optVerbose   = 1
56 56
 , optOffline   = []
57 57
 , optMinScore  = 1e-9
58 58
 , optShowVer   = False
......
90 90
    , Option ['v']     ["verbose"]
91 91
      (NoArg (\ opts -> opts { optVerbose = (optVerbose opts) + 1 }))
92 92
      "increase the verbosity level"
93
    , Option ['q']     ["quiet"]
94
      (NoArg (\ opts -> opts { optVerbose = (optVerbose opts) - 1 }))
95
      "decrease the verbosity level"
93 96
    , Option ['O']     ["offline"]
94 97
      (ReqArg (\ n opts -> opts { optOffline = n:optOffline opts }) "NODE")
95 98
      " set node as offline"
......
186 189
  (loaded_nl, il, csf, ktn, kti) <- liftM2 Cluster.loadData node_data inst_data
187 190
  let (fix_msgs, fixed_nl) = Cluster.checkData loaded_nl il ktn kti
188 191

  
189
  unless (null fix_msgs) $ do
192
  unless (null fix_msgs || verbose == 0) $ do
190 193
         putStrLn "Warning: cluster has inconsistent data:"
191 194
         putStrLn . unlines . map (\s -> printf "  - %s" s) $ fix_msgs
192 195

  
......
217 220
             (Container.size nl)
218 221
             (Container.size il)
219 222

  
220
  when (length csf > 0 && not oneline && verbose > 0) $ do
223
  when (length csf > 0 && not oneline && verbose > 1) $ do
221 224
         printf "Note: Stripping common suffix of '%s' from names\n" csf
222 225

  
223 226
  let (bad_nodes, bad_instances) = Cluster.computeBadItems nl il
......
246 249
                      ini_cv min_cv)
247 250
         exitWith ExitSuccess
248 251

  
249
  unless oneline (if verbose > 1 then
252
  unless oneline (if verbose > 2 then
250 253
                      printf "Initial coefficients: overall %.8f, %s\n"
251 254
                      ini_cv (Cluster.printStats nl)
252 255
                  else
......
263 266
      ord_plc = reverse fin_plc
264 267
      sol_msg = if null fin_plc
265 268
                then printf "No solution found\n"
266
                else (if verbose > 1
269
                else (if verbose > 2
267 270
                      then printf "Final coefficients:   overall %.8f, %s\n"
268 271
                           fin_cv (Cluster.printStats fin_nl)
269 272
                      else printf "Cluster score improved from %.8f to %.8f\n"
......
297 300
         putStrLn ""
298 301
         putStrLn "Final cluster status:"
299 302
         putStrLn $ Cluster.printNodes ktn fin_nl
300
         when (verbose > 2) $
303
         when (verbose > 3) $
301 304
              do
302 305
                printf "Original: mem=%d disk=%d\n" orig_mem orig_disk
303 306
                printf "Final:    mem=%d disk=%d\n" final_mem final_disk

Also available in: Unified diff