diff --git a/.config/zsh/zshrc.d/40-functions.zsh b/.config/zsh/zshrc.d/40-functions.zsh index 542d153..549c8d4 100644 --- a/.config/zsh/zshrc.d/40-functions.zsh +++ b/.config/zsh/zshrc.d/40-functions.zsh @@ -619,3 +619,14 @@ pyhelp() { $py_exec -c "${import_statement}help($arg)" done } + +# A small wrapper that tries to prevent an overwrite of an existing file when +# forgetting to specify the destination-file. +pdfunite() { + if [[ -e "$@[-1]" ]]; then + print >&2 "Destination-file exists already!" + return 2 + fi + + command "$@" +}