mqliang commented on a change in pull request #6969: URL: https://github.com/apache/incubator-pinot/pull/6969#discussion_r641260050
########## File path: compatibility-verifier/compCheck.sh ########## @@ -41,20 +41,54 @@ RM="/bin/rm" logCount=1 +#Declare the number of mandatory args +margs=2 # get usage of the script function usage() { command=$1 - echo "Usage: $command workingDir testSuiteDir" - exit 1 + echo "Usage: $command -w <workingDir> -t <testSuiteDir> -k true/false" +} + +function help() { + usage + echo -e "MANDATORY:" + echo -e " -w, --working-dir Working directory where olderCommit and newCommit target files reside." + echo -e " -t, --test-suite-dir Test suite directory\n" + echo -e "OPTIONAL:" + echo -e " -k, --keep-cluster-on-failure Whether keep cluster on test failure (default: false)" + echo -e " -h, --help Prints this help\n" +} + +# Ensures that the number of passed args are at least equals +# to the declared number of mandatory args. +# It also handles the special case of the -h or --help arg. +function margs_precheck() { + if [ $2 ] && [ $1 -lt $margs ]; then + if [ $2 == "--help" ] || [ $2 == "-h" ]; then + help + exit + else + usage compCheck + exit 1 # error + fi + fi +} + +# Ensures that all the mandatory args are not empty +function margs_check() { + if [ $# -lt $margs ]; then Review comment: not add the check yet, since if the oldTargetDir and newTargetDir not exist, the test will fail anyway. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org