From 5127824a7f38720629952c64bafa4516cd351f65 Mon Sep 17 00:00:00 2001 From: Renato Alves Date: Sun, 6 Mar 2016 04:23:32 +0100 Subject: Default to secret gists by setting PUBLIC_gists=false --- wgetpaste | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wgetpaste b/wgetpaste index a754ebe..a88da45 100755 --- a/wgetpaste +++ b/wgetpaste @@ -85,7 +85,7 @@ escape_input_gists() { sed -e 's|\\|\\\\|g' -e 's|\x1b|\\u001b|g' -e 's|\r||g' - json_gists() { local description="${1}" language="${2}" content="${3}" [[ "$language" = auto ]] && language="" || language=".$language" - echo "{\"description\":\"${description}\",\"public\":\"true\",\"files\":{\"${description//\/}${language}\":{\"content\":\"${content}\"}}" + echo "{\"description\":\"${description}\",\"public\":\"${PUBLIC_gists}\",\"files\":{\"${description//\/}${language}\":{\"content\":\"${content}\"}}" } # lodgeit LANGUAGES_lodgeit="ABAP ActionScript ActionScript%3 Ada ANTLR ANTLR%With%ActionScript%Target \ @@ -352,6 +352,9 @@ per user in any of ~/.wgetpaste.conf or ~/.wgetpaste.d/*.conf. An additional http header can be passed by setting HEADER_\${SERVICE} in any of the configuration files mentioned above. For example, authenticating with github gist: HEADER_gists="Authorization: token 1234abc56789..." + +In the case of github gist you can also set PUBLIC_gists='false' if you want to +default to secret instead of public gists. EOF } @@ -671,6 +674,9 @@ NICK=${NICK:-$(escape "${DEFAULT_NICK}")} [[ -z $SOURCE ]] && SOURCE="stdin" CVT_TABS=No +PUBLIC_gists=${PUBLIC_gists:-true} +[[ "${PUBLIC_gists}" = "true" || "${PUBLIC_gists}" = "false" ]] || die "Invalid setting for PUBLIC_gists. Can either be 'true' or 'false' not '${PUBLIC_gists}'" + INFO_COMMAND=${INFO_COMMAND:-"emerge --info"} INFO_ARGS=${INFO_ARGS:-"--ignore-default-opts"} -- cgit v1.2.3