Is the a workaround to parsing the bash script arguments in an function
run command: ./script.sh -t -r -e
script:
#!/bin/sh
# parse argument function
parse_args() {
echo "$#" #<-- output: 0
}
# main
echo "$#" #<-- output: 3
# parsing arguments
parse_args
$@afterparse_args.