A few unittests improvements
[ganeti-local] / htools / Ganeti / HTools / CLI.hs
index fee8df8..69e0806 100644 (file)
@@ -1,7 +1,7 @@
 {-| Implementation of command-line functions.
 
 This module holds the common command-line related functions for the
-binaries, separated into this module since "Ganeti.HTools.Utils" is
+binaries, separated into this module since "Ganeti.Utils" is
 used in many other places and this is more IO oriented.
 
 -}
@@ -95,9 +95,9 @@ import qualified Ganeti.HTools.Container as Container
 import qualified Ganeti.HTools.Node as Node
 import qualified Ganeti.Path as Path
 import Ganeti.HTools.Types
-import Ganeti.HTools.Utils
 import Ganeti.BasicTypes
 import Ganeti.Common as Common
+import Ganeti.Utils
 
 -- * Data types
 
@@ -256,7 +256,7 @@ oSpindleUse =
        return $ opts { optSpindleUse = Just su })
     "SPINDLES") "select how many virtual spindle instances use\
                 \ [default read from cluster]",
-   OptComplNumeric)
+   OptComplFloat)
 
 oSelInst :: OptType
 oSelInst =
@@ -354,7 +354,7 @@ oMaxCpu =
        return $ opts { optMcpu = Just mcpu }) "RATIO")
    "maximum virtual-to-physical cpu ratio for nodes (from 0\
    \ upwards) [default read from cluster]",
-   OptComplNumeric)
+   OptComplFloat)
 
 oMaxSolLength :: OptType
 oMaxSolLength =
@@ -364,7 +364,7 @@ oMaxSolLength =
    "cap the solution at this many balancing or allocation \
    \ rounds (useful for very unbalanced clusters or empty \
    \ clusters)",
-   OptComplNumeric)
+   OptComplInteger)
 
 oMinDisk :: OptType
 oMinDisk =
@@ -372,7 +372,7 @@ oMinDisk =
    (reqWithConversion (tryRead "min free disk space")
     (\n opts -> Ok opts { optMdsk = n }) "RATIO")
    "minimum free disk space for nodes (between 0 and 1) [0]",
-   OptComplNumeric)
+   OptComplFloat)
 
 oMinGain :: OptType
 oMinGain =
@@ -380,7 +380,7 @@ oMinGain =
    (reqWithConversion (tryRead "min gain")
     (\g opts -> Ok opts { optMinGain = g }) "DELTA")
    "minimum gain to aim for in a balancing step before giving up",
-   OptComplNumeric)
+   OptComplFloat)
 
 oMinGainLim :: OptType
 oMinGainLim =
@@ -388,7 +388,7 @@ oMinGainLim =
    (reqWithConversion (tryRead "min gain limit")
     (\g opts -> Ok opts { optMinGainLim = g }) "SCORE")
    "minimum cluster score for which we start checking the min-gain",
-   OptComplNumeric)
+   OptComplFloat)
 
 oMinScore :: OptType
 oMinScore =
@@ -396,7 +396,7 @@ oMinScore =
    (reqWithConversion (tryRead "min score")
     (\e opts -> Ok opts { optMinScore = e }) "EPSILON")
    "mininum score to aim for",
-   OptComplNumeric)
+   OptComplFloat)
 
 oNoHeaders :: OptType
 oNoHeaders =
@@ -526,6 +526,7 @@ genericOpts =  [ oShowVer
 parseOpts :: [String]               -- ^ The command line arguments
           -> String                 -- ^ The program name
           -> [OptType]              -- ^ The supported command line options
+          -> [ArgCompletion]        -- ^ The supported command line arguments
           -> IO (Options, [String]) -- ^ The resulting options and leftover
                                     -- arguments
 parseOpts = Common.parseOpts defaultOptions