Uniquify adjacent identical selection items

This is a potential solution for #30.
This commit is contained in:
Chris Down 2016-11-03 20:36:58 -06:00
parent 6e6c4ed430
commit 3e50f9460a

View file

@ -39,7 +39,7 @@ done
# whether `-l` is also in "$@", because the way that dmenu works allows a later # whether `-l` is also in "$@", because the way that dmenu works allows a later
# argument to override an earlier one. That is, if the user passes in `-l`, our # argument to override an earlier one. That is, if the user passes in `-l`, our
# one will be ignored. # one will be ignored.
chosen_line=$(printf '%s\n' "${ordered_selections[@]}" | dmenu -l 8 "$@") chosen_line=$(printf '%s\n' "${ordered_selections[@]}" | uniq | dmenu -l 8 "$@")
[[ $chosen_line ]] || exit 1 [[ $chosen_line ]] || exit 1