diff --git a/.config/zsh/zshrc.d/40-functions.zsh b/.config/zsh/zshrc.d/40-functions.zsh index 0986edf..7f154e7 100644 --- a/.config/zsh/zshrc.d/40-functions.zsh +++ b/.config/zsh/zshrc.d/40-functions.zsh @@ -744,3 +744,17 @@ rmdir() { command rmdir "$@" fi } + +# bfs wrapper with condensed output by default (i.e. no directories except if +# they're empty) +(( ! $+commands[bfs] )) || bfs() { + emulate -L zsh + + # Check if arguments were passed that start with a dash + if (( $# && ${@[(I)-*]} )); then + command bfs "$@" + else + # Only print files and empty directories + command bfs "$@" -type f -o -type d -empty + fi +}