4 ms·
No, you're right. It was a pretty collaborative effort with me and Claude!
by anandchowdhary 11mo ago
No, you're right. It was a pretty collaborative effort with me and Claude!
- svieira 11mo agoFYI, you're missing two patterns that allow the `--key=value` admirers and the `-alltheshortopsinasinglestring` spacebar savers among us to be happy (for the otherwise excellent options parsing code). shopt -s extglob case "$1" # Flag support - allow -xyz z-takes-params -@(a|b|c)*) _flag=${1:1:1}; _rest=${1:2}; shift; set -- "-$_flag" "-$_rest" "$@";; # Param=Value support -?(-)*=*) _key=${1%%=*}; _value=${1#*=}; shift; set -- "${_key}" "$_value" "$@";; esac
- anandchowdhary 11mo agoFor letting me know! Would you like to create a PR? Otherwise I'll add you as a Co-Authored-By!
- svieira 11mo agoCo-authored is fine, thanks for asking!
- insin 11mo agoGesundheit