Revision 21839f47 htools/Ganeti/HTools/Program/Hbal.hs
b/htools/Ganeti/HTools/Program/Hbal.hs | ||
---|---|---|
4 | 4 |
|
5 | 5 |
{- |
6 | 6 |
|
7 |
Copyright (C) 2009, 2010, 2011 Google Inc. |
|
7 |
Copyright (C) 2009, 2010, 2011, 2012 Google Inc.
|
|
8 | 8 |
|
9 | 9 |
This program is free software; you can redistribute it and/or modify |
10 | 10 |
it under the terms of the GNU General Public License as published by |
... | ... | |
23 | 23 |
|
24 | 24 |
-} |
25 | 25 |
|
26 |
module Ganeti.HTools.Program.Hbal (main) where |
|
26 |
module Ganeti.HTools.Program.Hbal (main, options) where
|
|
27 | 27 |
|
28 | 28 |
import Control.Concurrent (threadDelay) |
29 | 29 |
import Control.Exception (bracket) |
... | ... | |
31 | 31 |
import Data.List |
32 | 32 |
import Data.Maybe (isJust, isNothing, fromJust) |
33 | 33 |
import Data.IORef |
34 |
import System.Environment (getArgs) |
|
35 | 34 |
import System.Exit |
36 | 35 |
import System.IO |
37 | 36 |
import System.Posix.Process |
... | ... | |
338 | 337 |
exitWith ExitSuccess |
339 | 338 |
|
340 | 339 |
-- | Main function. |
341 |
main :: IO () |
|
342 |
main = do |
|
343 |
cmd_args <- getArgs |
|
344 |
(opts, args) <- parseOpts cmd_args "hbal" options |
|
345 |
|
|
340 |
main :: Options -> [String] -> IO () |
|
341 |
main opts args = do |
|
346 | 342 |
unless (null args) $ do |
347 | 343 |
hPutStrLn stderr "Error: this program doesn't take any arguments." |
348 | 344 |
exitWith $ ExitFailure 1 |
Also available in: Unified diff