summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/keyringer/actions/tree7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/keyringer/actions/tree b/lib/keyringer/actions/tree
index 7bf173d..a877548 100755
--- a/lib/keyringer/actions/tree
+++ b/lib/keyringer/actions/tree
@@ -5,7 +5,7 @@
# 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
@@ -19,6 +19,11 @@ CWD="`pwd`"
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"