diff options
author | Florian Pritz <bluewind@xinu.at> | 2011-06-04 22:51:18 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2011-06-04 22:51:18 +0200 |
commit | 9ed7e989478ae322d0e0fc9c41719c33c192ad80 (patch) | |
tree | b5794501b9f05d95b4d6d71f5a7b0d5cea033a24 | |
parent | edc4600010c985a09b048bfce39b73dbe10167a2 (diff) |
use -c for decompression when used with -g
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | fb.in | 10 | ||||
-rw-r--r-- | fb.pod | 3 |
2 files changed, 11 insertions, 2 deletions
@@ -103,10 +103,10 @@ usage: [cat |] `basename "$0"` [switches] [options] [<file(s)|ID(s)|folder(s)>] -v show the client version Options: - These have no effect if used in conjunction with a switch -e <extension> extension for default highlighting (e.g. "diff") -t upload a tar file containing all files (and directories) -c compress the file being uploaded with gz or xz if used 2 times + When used in conjunction with -g this decompresses the download ! } @@ -146,7 +146,13 @@ if [ "$DELETE" ] || [ "$GET" ]; then if [ "$DELETE" ]; then $LIBDIR/fb-helper d "$PASTEBIN/file/delete/$i" || EXITCODE=1 elif [ "$GET" ]; then - $LIBDIR/fb-helper d "$PASTEBIN/$i" || EXITCODE=1 + if [ "$COMPRESS" = "1" ]; then + $LIBDIR/fb-helper d "$PASTEBIN/$i" | zcat || EXITCODE=1 + elif [ "$COMPRESS" = "2" ]; then + $LIBDIR/fb-helper d "$PASTEBIN/$i" | xzcat || EXITCODE=1 + else + $LIBDIR/fb-helper d "$PASTEBIN/$i" || EXITCODE=1 + fi fi done elif [ $# -eq 0 ]; then @@ -62,6 +62,9 @@ If you want to be able to delete files, you have to add the following line to ~/ Specify this option once to use gzip or two times to use xz. + If used in conjunction with the -g switch this decompresses the download + before it's output to stdout. + =head1 EXAMPLES fb -tc <folder> <file> |