From c508cea2c0e8c37eecf2750771375e34e0e1ea99 Mon Sep 17 00:00:00 2001 From: uroboro Date: Fri, 30 Jun 2017 15:04:30 -0300 Subject: [PATCH] [spectred] Add title option to script. Fixes #1. --- cmd/spectred/public/ghost.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/spectred/public/ghost.sh b/cmd/spectred/public/ghost.sh index 4eefde3..40ef57f 100755 --- a/cmd/spectred/public/ghost.sh +++ b/cmd/spectred/public/ghost.sh @@ -12,6 +12,7 @@ function usage() { echo " $prog -U - Upgrade ghost.sh (this will replace $0)" >&2 echo "Options:" >&2 echo " -x - Expiration for paste (with units: ns/us/ms/s/m/h)" >&2 + echo " -t - Title for paste" >&2 echo " -p - Prompt for password" >&2 echo " -S <server> - Override server" >&2 echo " -i - Use http" >&2 @@ -75,6 +76,9 @@ while getopts "d:e:FhIiLlpS:s:t:Uu:x:" o; do mode="show" paste=$OPTARG ;; + t) + title=$OPTARG + ;; U) mode="upgrade" ;; @@ -218,6 +222,7 @@ url="${server}/paste/new" [[ $passworded -eq 1 ]] && _password pw && echo export -a curl_formargs=("--data-urlencode" "text@$filename") [[ ! -z "${lang}" ]] && curl_formargs+=("--data-urlencode" "lang=${lang}") +[[ ! -z "${title}" ]] && curl_formargs+=("--data-urlencode" "title=${title}") [[ ! -z "${pw}" ]] && curl_formargs+=("--data-urlencode" "password=${pw}") [[ ! -z "${expiry}" ]] && curl_formargs+=("--data-urlencode" "expire=${expiry}")