Added -S|--silent option to clainsafecli
This allows you not to print the progress bar
This commit is contained in:
parent
7fec1f8e01
commit
6608a22922
1 changed files with 8 additions and 3 deletions
|
@ -18,7 +18,7 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
int tor_flag, i2p_flag;
|
int tor_flag, i2p_flag;
|
||||||
tor_flag = i2p_flag = 0;
|
tor_flag = i2p_flag = 0;
|
||||||
|
long silent_flag = 0L;
|
||||||
char *buffer = (char *)calloc(1024,sizeof(char));
|
char *buffer = (char *)calloc(1024,sizeof(char));
|
||||||
if(buffer == NULL) {
|
if(buffer == NULL) {
|
||||||
fprintf(stderr,"Error allocating memory!\n");
|
fprintf(stderr,"Error allocating memory!\n");
|
||||||
|
@ -41,11 +41,13 @@ main(int argc, char **argv)
|
||||||
{"help" ,no_argument ,0,'h'},
|
{"help" ,no_argument ,0,'h'},
|
||||||
{"tor" ,no_argument ,0,'t'},
|
{"tor" ,no_argument ,0,'t'},
|
||||||
{"i2p" ,no_argument ,0,'i'},
|
{"i2p" ,no_argument ,0,'i'},
|
||||||
|
{"silent",no_argument ,0,'S'},
|
||||||
{0 ,0 ,0, 0 }
|
{0 ,0 ,0, 0 }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int c = 0;
|
int c = 0;
|
||||||
while((c = getopt_long(argc,argv, "htis:",
|
while((c = getopt_long(argc,argv, "htiSs:",
|
||||||
long_options,&option_index)) != -1) {
|
long_options,&option_index)) != -1) {
|
||||||
switch(c) {
|
switch(c) {
|
||||||
case 's':
|
case 's':
|
||||||
|
@ -61,6 +63,9 @@ main(int argc, char **argv)
|
||||||
case 'i':
|
case 'i':
|
||||||
i2p_flag = 1;
|
i2p_flag = 1;
|
||||||
break;
|
break;
|
||||||
|
case 'S':
|
||||||
|
silent_flag = 1L;
|
||||||
|
break;
|
||||||
case '?':
|
case '?':
|
||||||
print_usage();
|
print_usage();
|
||||||
return 0;
|
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_setopt(easy_handle,CURLOPT_HTTPPOST,post);
|
||||||
|
|
||||||
curl_easy_perform(easy_handle);
|
curl_easy_perform(easy_handle);
|
||||||
|
|
Loading…
Add table
Reference in a new issue