From dac64066d96262fabc54737e5ffc177eaf27c6ce Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Mon, 14 Aug 2017 01:19:35 -0400 Subject: [PATCH] Add private options for PA and paste --- shells/zshrc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/shells/zshrc b/shells/zshrc index a8d9550..75aacee 100644 --- a/shells/zshrc +++ b/shells/zshrc @@ -351,11 +351,16 @@ mv() { /bin/mv -v "$@" } m() { mv "$@" } compdef _cp c cfat m mv cp adb apush apull paste() { - NAME="-d title=Command run at $(date '+%d/%h/%y %H:%M:%S') on $(hostname)" + local PRIVATE=0 + if [[ ! -z "$1" ]] && [[ "$1" -eq "-p" ]]; then + PRIVATE=1 + shift + fi + local NAME="-d title=Command run at $(date '+%d/%h/%y %H:%M:%S') on $(hostname)" if [[ ! -z "$1" ]]; then NAME="-d title=$1" fi - sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | curl --data-urlencode text@- $NAME -d name=$USER -d expire="40320" https://austenwares.com/paste/api/create + sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | curl --data-urlencode text@- $NAME -d name=$USER -d expire="40320" -d private="$PRIVATE" https://austenwares.com/paste/api/create } grename() { echo incomplete