diff options
author | P. J. McDermott <pj@pehjota.net> | 2015-10-27 20:50:51 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2015-10-27 20:50:51 (EDT) |
commit | 6e91cf0fdc0d4236e1ff91969dcd042f0b7907fb (patch) | |
tree | b3db7460f8a7057c26d0f057327729a488bc8974 | |
parent | 7d2facf954dd616242301750bb0a7e05a5abc542 (diff) | |
download | firman.sh-6e91cf0fdc0d4236e1ff91969dcd042f0b7907fb.zip firman.sh-6e91cf0fdc0d4236e1ff91969dcd042f0b7907fb.tar.gz firman.sh-6e91cf0fdc0d4236e1ff91969dcd042f0b7907fb.tar.bz2 |
do_update(): Show distributor names in menu
-rw-r--r-- | src/action/update.sh | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/action/update.sh b/src/action/update.sh index 3d897bc..7cbfcf3 100644 --- a/src/action/update.sh +++ b/src/action/update.sh @@ -17,7 +17,7 @@ do_update() { - local dists='' + local dist_ids='' local i=0 local dist='' local mirror_url='' @@ -32,20 +32,22 @@ do_update() fi # Select distributor. - # TODO: Show names in menu labels. - dists="$(board_get_dists)" - if [ $(printf '%s' "${dists}" | wc -w | cut -d ' ' -f 1) -gt 1 ]; then - i=$(show_menu 'Select a firmware distributor' ${dists}) + dist_ids="$(board_get_dists)" + if [ $(printf '%s' "${dist_ids}" | wc -w | cut -d ' ' -f 1) -gt 1 ]; then + set -- + for dist_id in ${dist_ids}; do + set -- "${@}" "$(dist_get_name "${dist_id}")" + done + i=$(show_menu 'Select a firmware distributor' "${@}") i=$(($i + 1)) - dist="$(printf '%s ' ${dists} | cut -d ' ' -f ${i})" + dist="$(printf '%s ' ${dist_ids} | cut -d ' ' -f ${i})" else - dist="$(printf '%s' ${dists})" + dist="$(printf '%s' ${dist_ids})" fi select_dist "${dist}" info 'Distributor: %s' "${dist}" # Select mirror. - # TODO: Handle show_menu() output. set -- while :; do if ! read -r mirror_url || ! read -r mirror_label; then |