summaryrefslogtreecommitdiffstats
path: root/fb.in
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-01-09 16:57:25 +0100
committerFlorian Pritz <bluewind@xinu.at>2013-01-09 16:59:05 +0100
commit18f85cc73adf723b8bf1aad9a2c3e9a5898648fb (patch)
tree76f586cac208d4e6bc404626024d67a3556ed5e4 /fb.in
parent1aa1cbf8e5bc134b620ed153534b4891195d4b55 (diff)
Add debugging support
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'fb.in')
-rw-r--r--fb.in13
1 files changed, 12 insertions, 1 deletions
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] [<file(s)|ID(s)|folder(s)>]
-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