summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <>2007-04-07 00:24:17 +0000
committererdgeist <>2007-04-07 00:24:17 +0000
commit77e5241cf8a941faf36442dbda43c93e4396ac3b (patch)
tree8c013a7d267a66cc77ffcdca16ddb30f061eeb2f
parent5c18293c9c7b2c5f419135b1705f07460e7773b0 (diff)
Clean up help and usage
-rw-r--r--opentracker.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/opentracker.c b/opentracker.c
index 0d4f2b5..af4db14 100644
--- a/opentracker.c
+++ b/opentracker.c
@@ -485,20 +485,22 @@ static void graceful( int s ) {
485} 485}
486 486
487static void usage( char *name ) { 487static void usage( char *name ) {
488 fprintf( stderr, "Usage: %s [-i serverip] [-p serverport] [-d serverdirectory]" 488 fprintf( stderr, "Usage: %s [-i ip] [-p port] [-P port] [-d dir] [-A ip]\n", name );
489 "\n", name );
490} 489}
491 490
491#define HELPLINE(opt,desc) fprintf(stderr, "\t%-10s%s\n",opt,desc)
492static void help( char *name ) { 492static void help( char *name ) {
493 usage( name ); 493 usage( name );
494 fprintf( stderr, "\t-i serverip\tspecify ip to bind to (default: *, you may specify more than one)\n" 494
495 "\t-p serverport\tspecify tcp port to bind to (default: 6969, you may specify more than one)\n" 495 HELPLINE("-i ip","specify ip to bind to (default: *, you may specify more than one)");
496 "\t-P serverport\tspecify udp port to bind to (default: 6969, you may specify more than one)\n" 496 HELPLINE("-p port","specify tcp port to bind to (default: 6969, you may specify more than one)");
497 "\t-d serverdir\tspecify directory containing white- or black listed torrent info_hashes (default: \".\")\n" 497 HELPLINE("-P port","specify udp port to bind to (default: 6969, you may specify more than one)");
498 "\t-A adminip\tbless an ip address as admin address (e.g. to allow snycs from this address)\n" 498 HELPLINE("-d dir","specify directory containing white- or black listed torrent info_hashes (default: \".\")");
499 "\nExample: ./opentracker -i 127.0.0.1 -p 6969 -P 6969 -i 10.1.1.23 -p 2710 -p 80\n" 499 HELPLINE("-A ip","bless an ip address as admin address (e.g. to allow syncs from this address)");
500); 500
501 fprintf( stderr, "\nExample: ./opentracker -i 127.0.0.1 -p 6969 -P 6969 -i 10.1.1.23 -p 2710 -p 80\n" );
501} 502}
503#undef HELPLINE
502 504
503static void handle_read( const int64 clientsocket ) { 505static void handle_read( const int64 clientsocket ) {
504 struct http_data* h = io_getcookie( clientsocket ); 506 struct http_data* h = io_getcookie( clientsocket );