The total number of supplied command-line arguments is hold by a in bash's internal variable $#. Consider a following example of simple bash script which will print out a total number of supplied command-line arguments to the STDOUT:

echo $#

Save the file as and execute it as follows:

$ bash  a b c d e 

The example above shows us that the four arguments separated by space are passed to the script. The number of arguments received by the script is stored in the internal variable $#

Make sure that script has received the correct number of arguments.

It is always good or even required that if a script receives arguments then we should ensure that the script receives that correct number. This can be done as follows:

if [ "$#" -ne 2 ]; then
    echo "You must enter exactly 2 command line arguments"
    exit 1

Easy Peasy.