From d923956d4866beb5093c89e0c1a4f54a9c37070f Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Tue, 18 Aug 2015 01:39:43 +0200 Subject: major fixes and rearrangement --- tools/sprunge | 62 ----------------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100755 tools/sprunge (limited to 'tools/sprunge') diff --git a/tools/sprunge b/tools/sprunge deleted file mode 100755 index a6e89a4..0000000 --- a/tools/sprunge +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -usage() { -description | fmt -s >&2 -} - -description() { -cat << HERE - -DESCRIPTION - Upload data and fetch URL from the pastebin http://sprunge.us - -USAGE - $0 filename.txt - $0 text string - $0 < filename.txt - piped_data | $0 - -NOTES --------------------------------------------------------------------------- -* INPUT METHODS * -$0 can accept piped data, STDIN redirection [&2 - if [ "$*" ]; then - echo Arguments present... >&2 - if [ -f "$*" ]; then - echo Uploading the contents of "$*"... >&2 - cat "$*" - else - echo Uploading the text: \""$*"\"... >&2 - echo "$*" - fi | curl -F 'sprunge=<-' http://sprunge.us | xclip - else - echo No arguments found, will upload clipboard, also printing USAGE and exiting. >&2 - xclip -o | curl -F 'sprunge=<-' http://sprunge.us | xclip - notify-send Uploaded clipboard to sprunge - usage - fi -else - echo Using input from a pipe or STDIN redirection... >&2 - while read -r line ; do - echo $line - done | curl -F 'sprunge=<-' http://sprunge.us | xclip -fi -- cgit v1.2.3-54-g00ecf