Clean up defaults

This commit is contained in:
Nicholas Chambers 2020-07-05 23:27:04 -05:00
parent 9c242a93d1
commit 9210a76291
1 changed files with 8 additions and 4 deletions

12
karahti
View File

@ -10,7 +10,7 @@ has() {
for prog in curl; do
if ! has "$prog"; then
printf 'please install %s\n' "$prog" >&2
printf "please install %s\n" "$prog" >&2
exit 1
fi
done
@ -42,8 +42,12 @@ while (( $# )); do
shift
done
tail -n +1 -- "$@" | curl -sSA karahti/1.0 -w "%{redirect_url}" \
-F "paste_content=<-" -F "language=${opts[lang]:-auto}" \
-F "expiry=${opts[expire]}" https://p.ahti.space/nanopaste-get.cgi
lang=${opts[lang]:-auto}
expiry=${opts[expire]}
url=${opts[url]:-https://p.ahti.space/nanopaste-get.cgi}
tail -n +1 -- "$@" | curl -sSA karahti/1.0 -w %{redirect_url} \
-F "paste_content=<-" -F "language=$lang" -F "expiry=$expiry" \
"$url"
printf "\n"