summaryrefslogtreecommitdiffstats
path: root/fb-helper.c
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2014-08-29 17:58:28 +0200
committerFlorian Pritz <bluewind@xinu.at>2014-08-29 17:58:28 +0200
commit0a8145685d8d13da0c12e61b034a2323a22f46e2 (patch)
tree36ecb02b48308a61f92132b71e3b918b5caa852b /fb-helper.c
parent8e035bd403c155ca8b9a5db960f37a3c054faaa1 (diff)
Support multipastesv1.4
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'fb-helper.c')
-rw-r--r--fb-helper.c27
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':