Merge pull request #40 from Calinou/add-colors-to-list

Add colors and improve alignment in the list display
This commit is contained in:
Lazarus Lazaridis 2018-08-12 21:32:51 +03:00 committed by GitHub
commit 9d63b297df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -123,9 +123,11 @@ _goto_expand_directory()
# Lists registered aliases.
_goto_list_aliases()
{
local IFS=$'\n'
local IFS=$' '
if [ -f "$GOTO_DB" ]; then
column -t "$GOTO_DB" 2>/dev/null
while read -r name directory; do
printf '\e[1;36m%20s \e[0m%s\n' "$name" "$directory"
done < "$GOTO_DB"
else
echo "You haven't configured any directory aliases yet."
fi