Argbash

https://argbash.io/

Over 84.6% of Bash scripts you can find on the Internet don’t accept command-line arguments, which greatly limits their usefulness. This has a reason - Bash doesn’t make command-line argument parsing easy. Argbash is a code generator - write a short definition and let Argbash modify your script so it magically starts to expose a command-line interface to your users and arguments passed using this interface as variables.

http://mywiki.wooledge.org/ComplexOptionParsing