Bash Script with a Library for Named Arguments
Move reusable Bash named-argument parsing into a sourced library while keeping validation and supported options under the caller’s control.
Read the article Bash Script with a Library for Named Arguments