add function getargnum
authordyoung@redhat.com <dyoung@redhat.com>
Thu, 17 Jan 2013 08:55:50 +0000 (16:55 +0800)
committerHarald Hoyer <harald@redhat.com>
Wed, 23 Jan 2013 14:24:27 +0000 (15:24 +0100)
commita08ea34aba543bb52995c51463d82caa30f0941a
tree1b6c5df883980aaffbc2824c5d0638a6b6c22a89
parent6cb77ea91f3e6cc4fc7b92276a971e7b154306b9
add function getargnum

For cmdline argument with numeric value, add a new function getargnum
It will get proper value with default value as $1, min value as $2,
max value as $3, and param name as $4. valid result will be echo to stdout.
for nul or value not valid it will just echo the default value.
Note: The values should be >=0

[v1->v2]: add arg <minval>
[v2->v3]: do not use bash string match =~

Signed-off-by: Dave Young <dyoung@redhat.com>
modules.d/99base/dracut-lib.sh