Add private options for PA and paste

This commit is contained in:
Austen Adler 2017-08-14 01:19:35 -04:00
parent e3ccab18c4
commit dac64066d9

View File

@ -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