mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Capture url output, output syntax if we know what it is.
This commit is contained in:
parent
d8d7b45f96
commit
f498551664
1 changed files with 10 additions and 3 deletions
|
|
@ -49,14 +49,21 @@ sprunge() {
|
|||
print(get_lexer_for_filename('$*').aliases[0])
|
||||
except:
|
||||
print('text')" | python)
|
||||
cat "$*" | curl -F 'sprunge=<-' http://sprunge.us
|
||||
url=$(cat "$*" | curl -F 'sprunge=<-' http://sprunge.us)
|
||||
fi
|
||||
else
|
||||
usage
|
||||
fi
|
||||
else
|
||||
while read -r line ; do
|
||||
syntax="text" # We're dumb in this mode. So, dumb syntax highlighting!
|
||||
url=$(while read -r line ; do
|
||||
echo $line
|
||||
done | curl -F 'sprunge=<-' http://sprunge.us
|
||||
done | curl -F 'sprunge=<-' http://sprunge.us)
|
||||
fi
|
||||
|
||||
if [ "$syntax" -ne "text" ]; then
|
||||
echo "$url?$syntax"
|
||||
else
|
||||
echo $url
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue