fix check of array of commands

fix check of array of commands to passed in arguments.  Since we can add options to the passed in arguments, we need to check the last argument passed for the command name.  This is how it is shown in the --help result (command is last).