diff --git a/autotools/build-bash-completion b/autotools/build-bash-completion index 0dd77b02d40c95226185687740472704fc569aab..058ae770536215025d2a7c7f9907b09bd15930de 100755 --- a/autotools/build-bash-completion +++ b/autotools/build-bash-completion @@ -644,9 +644,10 @@ def HaskellOptToOptParse(opts, kind): return cli.cli_option(*opts, action="store_true") elif kind in ["file", "string", "host", "dir", "inetaddr"]: return cli.cli_option(*opts, type="string") - elif kind == "numeric": - # FIXME: float values here - return cli.cli_option(*opts, type="string") + elif kind == "integer": + return cli.cli_option(*opts, type="int") + elif kind == "float": + return cli.cli_option(*opts, type="float") elif kind == "onegroup": return cli.cli_option(*opts, type="string", completion_suggest=cli.OPT_COMPL_ONE_NODEGROUP) diff --git a/htools/Ganeti/Common.hs b/htools/Ganeti/Common.hs index 94e256ddb2a6288b72470c6fc6b19617850f9558..4e5a275e7c45e607c9c58c085f266e9f9f97b68f 100644 --- a/htools/Ganeti/Common.hs +++ b/htools/Ganeti/Common.hs @@ -71,7 +71,8 @@ data OptCompletion = OptComplNone -- ^ No parameter to this option | OptComplOneIallocator -- ^ One iallocator | OptComplInstAddNodes -- ^ Either one or two nodes | OptComplOneGroup -- ^ One group - | OptComplNumeric -- ^ Float values + | OptComplInteger -- ^ Integer values + | OptComplFloat -- ^ Float values | OptComplJobId -- ^ Job Id | OptComplCommand -- ^ Command (executable) | OptComplString -- ^ Arbitrary string diff --git a/htools/Ganeti/Daemon.hs b/htools/Ganeti/Daemon.hs index 43187ed9f27d696cbf36d3c2e06413a522dc27cd..94676ad1544bca819d4e0bcda3250f2ca36ab8c2 100644 --- a/htools/Ganeti/Daemon.hs +++ b/htools/Ganeti/Daemon.hs @@ -144,7 +144,7 @@ oPort def = (reqWithConversion (tryRead "reading port") (\port opts -> Ok opts { optPort = Just port }) "PORT") ("Network port (default: " ++ show def ++ ")"), - OptComplNumeric) + OptComplInteger) oBindAddress :: OptType oBindAddress = diff --git a/htools/Ganeti/HTools/CLI.hs b/htools/Ganeti/HTools/CLI.hs index 542a5847b87dcd9f2a236671ab22091c14651445..69e08064b73061d8e6d64cb7c70b132b3eac0f05 100644 --- a/htools/Ganeti/HTools/CLI.hs +++ b/htools/Ganeti/HTools/CLI.hs @@ -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 =