From 18f85cc73adf723b8bf1aad9a2c3e9a5898648fb Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 9 Jan 2013 16:57:25 +0100 Subject: Add debugging support Signed-off-by: Florian Pritz --- fb.in | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'fb.in') diff --git a/fb.in b/fb.in index ce56a6d..d96146b 100644 --- a/fb.in +++ b/fb.in @@ -46,6 +46,7 @@ compress=0 display_history= clipboard="" exitcode=0 +debug= base64_encode() { if type base64 2>&1 >/dev/null; then @@ -68,6 +69,10 @@ request_helper() { if [ -x "$libdir/fb-helper" ]; then helperopts="" + if [ "$debug" ]; then + helperopts="$helperopts -D" + fi + if [ "$mode" = "d" ]; then $libdir/fb-helper $helperopts -u "$url" fi @@ -79,6 +84,10 @@ request_helper() { useragent="fb-client/shell-$version" curlopts="-# -n -L -A $useragent --speed-time 30 --speed-limit 1 --connect-timeout 10" + if [ "$debug" ]; then + curlopts="$curlopts -v" + fi + if [ "$mode" = "d" ]; then curlopts="$curlopts -s" fi @@ -222,6 +231,7 @@ usage: [cat |] `basename "$0"` [switches] [options] [] -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 + -D show debugging information ! } @@ -230,7 +240,7 @@ if ! type getopts >/dev/null 2>&1; then exit 1 fi -while getopts "e:gdhHtcv" option; do +while getopts "e:gdhHtcvD" option; do case $option in e) extension="$OPTARG";; g) get=1;; @@ -239,6 +249,7 @@ while getopts "e:gdhHtcv" option; do d) delete=1;; H) display_history=1;; v) printf "%s\n" "$version"; exit 0;; + D) debug=1;; h|\?) help; exit 0;; esac done -- cgit v1.2.3-24-g4f1b