get available accounts from muttrcs

This commit is contained in:
Luke Smith 2019-03-31 15:33:45 -04:00
parent 5929cd3025
commit 8b30d99552
No known key found for this signature in database
GPG Key ID: 4C50B54A911F6252

2
mw
View File

@ -294,7 +294,7 @@ wipe () { \
} }
pick() { \ pick() { \
numbered="$(grep "^accounts *=" "$HOME/.config/offlineimap/config" | sed 's/accounts *= *//g;s/,/ /g;s/ \+/\n/g' | nl)" numbered="$(ls $accdir/*muttrc | sed "s/.*\///;s/\..*//" | nl)"
[ "$(echo "$numbered" | wc -w)" = 0 ] && printf "No accounts to delete.\\n" && return 1 [ "$(echo "$numbered" | wc -w)" = 0 ] && printf "No accounts to delete.\\n" && return 1
printf "Select an accounts to %s:\\n" "$1" printf "Select an accounts to %s:\\n" "$1"
echo "$numbered" echo "$numbered"