diff options
author | Florian Pritz <bluewind@xinu.at> | 2013-01-09 16:57:25 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2013-01-09 16:59:05 +0100 |
commit | 18f85cc73adf723b8bf1aad9a2c3e9a5898648fb (patch) | |
tree | 76f586cac208d4e6bc404626024d67a3556ed5e4 /fb-helper.c | |
parent | 1aa1cbf8e5bc134b620ed153534b4891195d4b55 (diff) |
Add debugging support
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'fb-helper.c')
-rw-r--r-- | fb-helper.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fb-helper.c b/fb-helper.c index 56f9429..11d115e 100644 --- a/fb-helper.c +++ b/fb-helper.c @@ -48,6 +48,7 @@ struct progressData { }; struct options { + int debug; char *url; char *file; }; @@ -238,12 +239,14 @@ int main(int argc, char *argv[]) int opt; struct options options = { + .debug = 0, .file = NULL, .url = NULL }; - while ((opt = getopt(argc, argv, "u:f:m:")) != -1) { + while ((opt = getopt(argc, argv, "Du:f:m:")) != -1) { switch (opt) { + case 'D': options.debug = 1; break; case 'u': options.url = optarg; break; @@ -268,6 +271,10 @@ int main(int argc, char *argv[]) goto cleanup; } + if (options.debug > 0) { + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); + } + /* if we have a file to upload, add it as a POST request */ if (options.file) { struct stat statbuf; |