#!/bin/sh while test $# -gt 0; do case $1 in --apptitle) apptitle="$2" shift;shift ;; --text) text="$2" shift;shift ;; --title) title="$2" shift;shift ;; --buttons) buttons="$2" shift;shift ;; *) echo "Unknown option $1" exit 2 ;; esac done first_button="$(printf "%s" "$buttons" | cut -d';' -f1)" set -- --ok-label "$first_button" while buttons="$(printf "%s" "$buttons" | cut -d';' -f1 --complement)" test -n "$buttons" do set -- "$@" --extra-button "$(printf "%s" "$buttons" | cut -d';' -f1)" done #$(printf "%s" "$2" | sed 's/;$/"/g' | sed 's/;/" --extra-button "/g') #printf "%s" "$extra_buttons" echo "$@" # shellcheck disable=SC2086 zenity --info --title "${title:-$apptitle}" --text "$text" "$@" && printf "%s\n" "$first_button"