@@ -89,7 +89,8 @@ char const* _gethome(void);
89
89
/* Output */
90
90
int construct_url (char * buf , size_t buflen , char const * input ,
91
91
char const * platform );
92
- int construct_path (char * buf , size_t buflen , char const * home , char const * input ,
92
+ int construct_path (char * buf , size_t buflen , char const * home ,
93
+ char const * input ,
93
94
char const * platform );
94
95
int parse_tldrpage (char const * input );
95
96
int print_tldrpage (char const * input , char const * platform );
@@ -176,7 +177,7 @@ main(int argc, char** argv)
176
177
pbuf [len ] = '\0' ;
177
178
platform_flag = 1 ;
178
179
}
179
- break ;
180
+ break ;
180
181
181
182
default :
182
183
abort ();
@@ -236,7 +237,8 @@ main(int argc, char** argv)
236
237
if (print_tldrpage (buf , pbuf [0 ] != 0 ? pbuf : NULL ))
237
238
{
238
239
fprintf (stdout , "This page doesn't exist yet!\n" );
239
- fprintf (stdout , "Submit new pages here: https://github.com/tldr-pages/tldr\n" );
240
+ fprintf (stdout ,
241
+ "Submit new pages here: https://github.com/tldr-pages/tldr\n" );
240
242
return EXIT_FAILURE ;
241
243
}
242
244
}
@@ -245,7 +247,8 @@ main(int argc, char** argv)
245
247
}
246
248
247
249
int
248
- construct_url (char * buf , size_t buflen , char const * input , char const * platform )
250
+ construct_url (char * buf , size_t buflen , char const * input ,
251
+ char const * platform )
249
252
{
250
253
size_t baselen ;
251
254
size_t delimlen ;
@@ -411,9 +414,9 @@ print_tldrpage(char const* input, char const* poverride)
411
414
{
412
415
platform = poverride ;
413
416
if (strcmp (platform , "linux" ) != 0
414
- && strcmp (platform , "osx" ) != 0
415
- && strcmp (platform , "common" ) != 0
416
- && strcmp (platform , "sunos" ) != 0 )
417
+ && strcmp (platform , "osx" ) != 0
418
+ && strcmp (platform , "common" ) != 0
419
+ && strcmp (platform , "sunos" ) != 0 )
417
420
{
418
421
fprintf (stderr , "Error: platform %s is unsupported\n" , platform );
419
422
fprintf (stderr , "Supported platforms: linux / osx / sunos / common\n" );
@@ -478,7 +481,8 @@ print_version(char const* arg)
478
481
{
479
482
fprintf (stdout , "%s %s\n" , arg , VERSION_PRETTY );
480
483
fprintf (stdout , "Copyright (C) 2016 Arvid Gerstmann\n" );
481
- fprintf (stdout , "Source available at https://github.com/tldr-pages/tldr-cpp-client\n" );
484
+ fprintf (stdout ,
485
+ "Source available at https://github.com/tldr-pages/tldr-cpp-client\n" );
482
486
}
483
487
484
488
void
@@ -489,9 +493,11 @@ print_usage(char const* arg)
489
493
fprintf (stdout , "available commands:\n" );
490
494
fprintf (stdout , " %-20s %-30s\n" , "-v" , "print verbose output" );
491
495
fprintf (stdout , " %-20s %-30s\n" , "--version" , "print version and exit" );
492
- fprintf (stdout , " %-20s %-30s\n" , "-h, --help" , "print this help and exit" );
496
+ fprintf (stdout , " %-20s %-30s\n" , "-h, --help" ,
497
+ "print this help and exit" );
493
498
fprintf (stdout , " %-20s %-30s\n" , "-u, --update" , "update local database" );
494
- fprintf (stdout , " %-20s %-30s\n" , "-c, --clear-cache" , "clear local database" );
499
+ fprintf (stdout , " %-20s %-30s\n" , "-c, --clear-cache" ,
500
+ "clear local database" );
495
501
fprintf (stdout , " %-20s %-30s\n" , "-p, --platform=<platform>" ,
496
502
"select platform, supported are linux / osx / sunos / common" );
497
503
}
@@ -690,7 +696,7 @@ clear_localdb(int verbose)
690
696
if (homedir == NULL ) { return 1 ; }
691
697
692
698
homedirlen = strlen (homedir );
693
- if ((homedirlen + TLDR_HOME_LEN + 1 ) > 255 )
699
+ if ((homedirlen + TLDR_HOME_LEN + 1 ) > 255 )
694
700
{ return 1 ; }
695
701
696
702
memcpy (tmp , homedir , homedirlen );
@@ -939,7 +945,7 @@ progress_callback(void* clientp, curl_off_t dltotal, curl_off_t dlnow,
939
945
940
946
int
941
947
old_progress_callback (void * p , double dltotal , double dlnow ,
942
- double ultotal , double ulnow )
948
+ double ultotal , double ulnow )
943
949
{
944
950
return progress_callback (p , (curl_off_t )dltotal , (curl_off_t )dlnow ,
945
951
(curl_off_t )ultotal , (curl_off_t )ulnow );
@@ -1086,4 +1092,3 @@ download_content(char const* url, char** out, int verbose)
1086
1092
* out = NULL ;
1087
1093
return 1 ;
1088
1094
}
1089
-
0 commit comments