diff options
Diffstat (limited to 'fb-helper.c')
-rw-r--r-- | fb-helper.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/fb-helper.c b/fb-helper.c index b550887..261d3b8 100644 --- a/fb-helper.c +++ b/fb-helper.c @@ -221,11 +221,12 @@ void display_help() printf("Usage: fb-helper <options>\n"); printf("\n"); printf("Options:\n"); - printf(" -D Print debugging information\n"); - printf(" -h This help\n"); - printf(" -u <url> URL of pastebin or URL to download\n"); - printf(" -f <file> File to upload to URL\n"); - printf(" -a <file> Path to API key file\n"); + printf(" -D Print debugging information\n"); + printf(" -h This help\n"); + printf(" -u <url> URL of pastebin or URL to download\n"); + printf(" -f <file> File to upload to URL\n"); + printf(" -F key=value Post key=value\n"); + printf(" -a <file> Path to API key file\n"); } int main(int argc, char *argv[]) @@ -264,7 +265,7 @@ int main(int argc, char *argv[]) exit(0); } - while ((opt = getopt(argc, argv, "Du:f:m:a:h")) != -1) { + while ((opt = getopt(argc, argv, "Du:f:F:m:a:h")) != -1) { switch (opt) { case 'D': options.debug = 1; break; @@ -272,6 +273,20 @@ int main(int argc, char *argv[]) case 'f': options.file = optarg; break; + case 'F': + { + char *save = NULL; + char *key = strtok_r(optarg, "=", &save); + char *value = strtok_r(save, "=", &save); + + curl_formadd(&formpost, + &lastptr, + CURLFORM_COPYNAME, key, + CURLFORM_PTRCONTENTS, value, + CURLFORM_END); + } + break; + case 'a': options.apikeyfile = optarg; break; case 'h': |