#!/usr/bin/env bash # # List keys, tree version. # # Thanks http://www.centerkey.com/tree/ function keyringer_tree { ls -R $* | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' } # Load functions LIB="`dirname $0`/../functions" source "$LIB" maintenance $* || exit 1 # Aditional parameters CWD="`pwd`" # Avoid leading slash shift ARGS="`echo "$*" | sed -e "s|^/*||"`" # Check implementation if which tree &> /dev/null; then TREE="tree" else TREE="keyringer_tree" fi # Run list command cd "$KEYDIR/$RELATIVE_PATH" && $TREE $ARGS cd "$CWD"