Bash implementation of argument checking as a replactement of getopt or getopts