Merge pull request #21 from gundalow/patch-1

Improved validate_int
This commit is contained in:
Andrew Kesterson
2016-09-05 14:37:51 -07:00
committed by GitHub

View File

@@ -91,7 +91,10 @@ For example, this is a valid validator:
function validate_int
{
echo "$1" | grep -E '^[0-9]+$'
if [[ "$1" =~ ^[0-9]+$ ]] ; then
return 0
fi
return 1
}
cmdarg 'x' 'x-option' 'some opt' '' validate_int