aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-07-30 02:01:09 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-07-30 02:09:31 +1200
commite2e7bb95be82de2b4c8b57256f3bac86ec9b41ce (patch)
tree7a78389e75a3e5d69188e1e238a638eb08c5cbe7
parentAdd two missing periods (diff)
downloaddotfiles-e2e7bb95be82de2b4c8b57256f3bac86ec9b41ce.tar.gz
dotfiles-e2e7bb95be82de2b4c8b57256f3bac86ec9b41ce.zip
Move sprunge() Bash function to spr(1)
-rw-r--r--README.markdown2
-rw-r--r--bash/bashrc.d/sprunge.bash5
-rwxr-xr-xbin/spr4
-rw-r--r--man/man1/spr.123
4 files changed, 28 insertions, 6 deletions
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. <http://sprunge.us>
-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 <tom@sanctum.geek.nz>