Added -S|--silent option to clainsafecli

This allows you not to print the progress bar
This commit is contained in:
qorg11 2021-02-10 22:42:59 +01:00
parent 7fec1f8e01
commit 6608a22922
No known key found for this signature in database
GPG Key ID: 343FC20A4ACA62B9
1 changed files with 8 additions and 3 deletions

View File

@ -18,7 +18,7 @@ main(int argc, char **argv)
int tor_flag, i2p_flag;
tor_flag = i2p_flag = 0;
long silent_flag = 0L;
char *buffer = (char *)calloc(1024,sizeof(char));
if(buffer == NULL) {
fprintf(stderr,"Error allocating memory!\n");
@ -41,11 +41,13 @@ main(int argc, char **argv)
{"help" ,no_argument ,0,'h'},
{"tor" ,no_argument ,0,'t'},
{"i2p" ,no_argument ,0,'i'},
{"silent",no_argument ,0,'S'},
{0 ,0 ,0, 0 }
};
int c = 0;
while((c = getopt_long(argc,argv, "htis:",
while((c = getopt_long(argc,argv, "htiSs:",
long_options,&option_index)) != -1) {
switch(c) {
case 's':
@ -61,6 +63,9 @@ main(int argc, char **argv)
case 'i':
i2p_flag = 1;
break;
case 'S':
silent_flag = 1L;
break;
case '?':
print_usage();
return 0;
@ -118,7 +123,7 @@ main(int argc, char **argv)
*
*/
curl_easy_setopt(easy_handle,CURLOPT_NOPROGRESS,0L);
curl_easy_setopt(easy_handle,CURLOPT_NOPROGRESS,silent_flag);
curl_easy_setopt(easy_handle,CURLOPT_HTTPPOST,post);
curl_easy_perform(easy_handle);