diff paster.sh @ 48:fa7125489435

paster: make private pastes by default, closes #2481
author David Demelier <markand@malikania.fr>
date Fri, 14 Feb 2020 20:10:00 +0100
parents 39defd15564e
children 78a4062bed62
line wrap: on
line diff
--- a/paster.sh	Fri Feb 14 15:01:26 2020 +0100
+++ b/paster.sh	Fri Feb 14 20:10:00 2020 +0100
@@ -20,7 +20,7 @@
 language="nohighlight"
 title="Untitled"
 duration="month"
-private=0
+public=0
 verbose=0
 
 die()
@@ -223,16 +223,19 @@
 usage()
 {
 	cat 1>&2 <<-EOF
-	usage: paster [-LDvx] [-a author] [-l language] [-d duration] [-t title] filename host
+	usage: paster [-LDpv] [-a author] [-l language] [-d duration] [-t title] filename host
 	EOF
 	exit 1
 }
 
 send()
 {
-	if [ $private -eq 1 ]; then
+	if [ $public -eq 1 ]; then
+		with_private="--data private=off"
+	else
 		with_private="--data private=on"
 	fi
+
 	if [ $verbose -eq 0 ]; then
 		with_verbose="-s"
 	fi
@@ -252,7 +255,7 @@
 	die "abort: curl is required"
 fi
 
-while getopts "LDa:d:l:t:vx" opt; do
+while getopts "LDa:d:l:pt:v" opt; do
 	case "$opt" in
 	D)
 		durations
@@ -269,15 +272,15 @@
 	l)
 		language="$OPTARG"
 		;;
+	p)
+		public=1
+		;;
 	t)
 		title="$OPTARG"
 		;;
 	v)
 		verbose=1
 		;;
-	x)
-		private=1
-		;;
 	*)
 		usage
 		;;