From e2e7bb95be82de2b4c8b57256f3bac86ec9b41ce Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 30 Jul 2016 02:01:09 +1200 Subject: Move sprunge() Bash function to spr(1) --- README.markdown | 2 +- bash/bashrc.d/sprunge.bash | 5 ----- bin/spr | 4 ++++ man/man1/spr.1 | 23 +++++++++++++++++++++++ 4 files changed, 28 insertions(+), 6 deletions(-) delete mode 100644 bash/bashrc.d/sprunge.bash create mode 100755 bin/spr create mode 100644 man/man1/spr.1 diff --git a/README.markdown b/README.markdown index 479988d1..b0f71240 100644 --- a/README.markdown +++ b/README.markdown @@ -193,7 +193,6 @@ There are a few other little tricks in `bash/bashrc.d`, including: * `readz` -- Alias for `read -d '' -r` * `scr` -- Create a temporary directory and change into it * `sd` -- Switch to a sibling directory -* `sprunge` -- Pastebin frontend tool I pilfered from `#bash` on Freenode * `ud` -- Change into an indexed ancestor of a directory I also wrap a few command calls with functions to stop me from doing silly @@ -326,6 +325,7 @@ Installed by the `install-bin` target: * `plmu(1)` retrieves a list of installed modules from [`plenv`](https://github.com/tokuhirom/plenv), filters out any modules in `~/.plenv/non-cpan-modules`, and updates them all. +* `spr(1)` posts its input to the sprunge.us pastebin. * `stbl(1)` strips a trailing blank line from the files in its arguments. * `sue(8)` execs `sudoedit(8)` as the owner of all the file arguments given, perhaps in cases where you may not necessarily have `root` `sudo(8)` diff --git a/bash/bashrc.d/sprunge.bash b/bash/bashrc.d/sprunge.bash deleted file mode 100644 index 34406b0d..00000000 --- a/bash/bashrc.d/sprunge.bash +++ /dev/null @@ -1,5 +0,0 @@ -# #bash on Freenode use their own pastebin. This is a convenience function for -# posting code to it. -sprunge() { - curl -F 'sprunge=<-' http://sprunge.us < "${1:-/dev/stdin}" -} diff --git a/bin/spr b/bin/spr new file mode 100755 index 00000000..026ba359 --- /dev/null +++ b/bin/spr @@ -0,0 +1,4 @@ +#!/bin/sh +# Convenience script for posting to sprunge.us pastebin +cat "${@:-}" | +curl -F 'sprunge=<-' http://sprunge.us/ diff --git a/man/man1/spr.1 b/man/man1/spr.1 new file mode 100644 index 00000000..1039ae4b --- /dev/null +++ b/man/man1/spr.1 @@ -0,0 +1,23 @@ +.TH SPR 1 "July 2016" "Manual page for spr" +.SH NAME +.B spr +\- post input to sprunge.us pastebin and print the URL to stdout +.SH SYNOPSIS +.B spr +file +.br +.B spr +file1 file2 file3 +.br +declare -p | +.B spr +.SH DESCRIPTION +.B spr +uses curl(1) to make an HTTP POST request submitting all of its input (whether +files or stdin) to the sprunge.us pastebin. +.SH SEE ALSO +curl(1) +.br +https://github.com/rupa/sprunge +.SH AUTHOR +Tom Ryder -- cgit v1.2.3