From: Ray Strode Date: Mon, 21 Mar 2022 19:10:30 +0000 (-0400) Subject: scripts: Support short options being squished togethers for plymouth-set-default... X-Git-Tag: 23.51.283~94^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63cfc4eff57149bd73c78b5a24b33604ee73996a;p=thirdparty%2Fplymouth.git scripts: Support short options being squished togethers for plymouth-set-default-theme People expect to be able to squish short options together, so this commit adds some glob matching to support that feature. --- diff --git a/scripts/plymouth-set-default-theme.in b/scripts/plymouth-set-default-theme.in index ed999e90..c6ebd932 100755 --- a/scripts/plymouth-set-default-theme.in +++ b/scripts/plymouth-set-default-theme.in @@ -122,6 +122,27 @@ while [ $# -gt 0 ]; do DO_HELP=1 ;; + -[!-]*-*) + echo "Short options can't have embedded dashes" >&2 + echo $(usage) >&2 + exit 1 + ;; + + -[!-][!-]*) + COMPRESSED_OPTIONS="$1" + shift + + ARGS=($COMPRESSED_OPTIONS $(echo $COMPRESSED_OPTIONS | sed -e 's/^-//' -e 's/[^-]/-& /g') "$@") + + set -- "${ARGS[@]}" + ;; + + -*) + echo "Unknown option: '$1'" >&2 + echo $(usage) >&2 + exit 1 + ;; + *) if [ -n "$THEME_NAME" ]; then echo "You can only specify one theme at a time" >&2