# Thanks http://www.centerkey.com/tree/
function keyringer_tree {
- ls -R $* | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
+ find $* | sed -e 's/[^-][^\/]*\//| /g' | sed -r -e 's/\| ([^|])/|- \1/'
}
# Load functions
shift
ARGS="`echo "$*" | sed -e "s|^/*||"`"
+# on *BSD, find expects at least one argument with the path
+if [ "$ARGS" == "" ]; then
+ ARGS="./"
+fi
+
# Check implementation
if which tree &> /dev/null; then
TREE="tree"