mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Updated sprunge so if its called without any arguments it will read from stdin. To get help, use -h or --help. Also, we really don't need the massive wall of text for usage help.
This commit is contained in:
parent
69c6c04f64
commit
38da730806
1 changed files with 5 additions and 12 deletions
|
|
@ -6,19 +6,12 @@
|
|||
|
||||
sprunge_usage() {
|
||||
cat << HERE
|
||||
|
||||
DESCRIPTION
|
||||
Upload data and fetch URL from the pastebin http://sprunge.us
|
||||
|
||||
In addition to printing the returned URL, if the xset or xsel
|
||||
programs are available, the URL will also be copied to the
|
||||
PRIMARY selection and the CLIPBOARD selection.
|
||||
|
||||
USAGE
|
||||
Usage:
|
||||
sprunge [files]
|
||||
sprunge < file
|
||||
piped_data | sprunge
|
||||
|
||||
Upload data and fetch URL from the pastebin http://sprunge.us.
|
||||
HERE
|
||||
}
|
||||
|
||||
|
|
@ -39,12 +32,12 @@ sprunge() {
|
|||
|
||||
urls=()
|
||||
|
||||
if [[ ! -t 0 ]]; then
|
||||
if [[ ! -t 0 || $#argv -eq 0 ]]; then
|
||||
url=$(curl -s -F 'sprunge=<-' http://sprunge.us <& 0)
|
||||
urls=(${url//[[:space:]]})
|
||||
elif [[ $#argv -eq 0 ]]; then
|
||||
elif [[ $1 == '-h' || $1 == '--help' ]]; then
|
||||
sprunge_usage
|
||||
return 1
|
||||
return 0
|
||||
else
|
||||
# Use python to attempt to detect the syntax
|
||||
for file in $@; do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue