diff --git a/src/3proxy.c b/src/3proxy.c index c5fac4d..cef14f7 100644 --- a/src/3proxy.c +++ b/src/3proxy.c @@ -500,6 +500,7 @@ int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int #else fprintf(stderr, "\n if conffile is missing, configuration is expected from stdin\n"); #endif + fprintf(stderr, "available socket options:\n\t%s\n", printopts("\n\t")); fprintf(stderr, "\n%s %s\n%s\n", conf.stringtable[2], conf.stringtable[3], copyright); return 1; diff --git a/src/proxy.h b/src/proxy.h index 9e5b1fb..bda8c43 100644 --- a/src/proxy.h +++ b/src/proxy.h @@ -348,6 +348,7 @@ extern struct socketoptions { char * optname; } sockopts[]; void setopts(SOCKET s, int opts); +char * printopts(char *sep); #ifdef _WINCE char * CEToUnicode (const char *str); diff --git a/src/proxymain.c b/src/proxymain.c index 54ada6e..afb9409 100644 --- a/src/proxymain.c +++ b/src/proxymain.c @@ -104,6 +104,15 @@ struct socketoptions sockopts[] = { {0, NULL} }; +char optsbuf[1024]; + +char * printopts(char *sep){ + int i=0, pos=0; + for(; sockopts[i].optname; i++)pos += sprintf(optsbuf+pos,"%s%s",i?sep:"",sockopts[i].optname); + return optsbuf; +} + + int getopts(const char *s){ int i=0, ret=0; for(; sockopts[i].optname; i++)if(strstr(s,sockopts[i].optname)) ret |= (1<] " " \n" "Available options are:\n" - " -RIP:PORT - connect back IP:PORT to listen and accept connections\n" - " -rIP:PORT - connect back IP:PORT to establish connect back connection\n" - "%s" + "%s\n" + "\t%s\n" "%s" "\tExample: %s -d -i127.0.0.1 6666 serv.somehost.ru 6666\n\n" "%s", argv[0], conf.stringtable?conf.stringtable[3]: VERSION " (" BUILDDATE ")", - argv[0], loghelp, childdef.helpmessage, argv[0], + argv[0], loghelp, printopts("\n\t"), childdef.helpmessage, argv[0], #ifdef STDMAIN copyright #else