diff options
author | Yang Tse <yangsita@gmail.com> | 2010-01-08 01:48:54 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2010-01-08 01:48:54 +0000 |
commit | a114b7b1c062e86691bfec04595153b67734b7c7 (patch) | |
tree | 2a6b0da69fc698e8f774989d24c2c15aa4d63c9d /tests/server | |
parent | 8524c04ca98d9c0b5f90d685135e0466e0d8b386 (diff) |
sws and tftpd command line option naming adjustments
Diffstat (limited to 'tests/server')
-rw-r--r-- | tests/server/sws.c | 46 | ||||
-rw-r--r-- | tests/server/tftpd.c | 43 |
2 files changed, 74 insertions, 15 deletions
diff --git a/tests/server/sws.c b/tests/server/sws.c index 5f8900239..9b6d9da9a 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -1051,6 +1051,18 @@ int main(int argc, char *argv[]) if(argc>arg) pidname = argv[arg++]; } + else if(!strcmp("--logfile", argv[arg])) { + arg++; + if(argc>arg) + serverlogfile = argv[arg++]; + } + else if(!strcmp("--ipv4", argv[arg])) { +#ifdef ENABLE_IPV6 + ipv_inuse = "IPv4"; + use_ipv6 = FALSE; +#endif + arg++; + } else if(!strcmp("--ipv6", argv[arg])) { #ifdef ENABLE_IPV6 ipv_inuse = "IPv6"; @@ -1064,13 +1076,31 @@ int main(int argc, char *argv[]) arg++; } #endif - else if(argc>arg) { - - if(atoi(argv[arg])) - port = (unsigned short)atoi(argv[arg++]); - - if(argc>arg) - path = argv[arg++]; + else if(!strcmp("--port", argv[arg])) { + arg++; + if(argc>arg) { + port = (unsigned short)atoi(argv[arg]); + arg++; + } + } + else if(!strcmp("--srcdir", argv[arg])) { + arg++; + if(argc>arg) { + path = argv[arg]; + arg++; + } + } + else { + puts("Usage: sws [option]\n" + " --version\n" + " --logfile [file]\n" + " --pidfile [file]\n" + " --ipv4\n" + " --ipv6\n" + " --port [port]\n" + " --srcdir [path]\n" + " --fork"); + return 0; } } diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index c569085dc..88377a829 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -682,6 +682,18 @@ int main(int argc, char **argv) if(argc>arg) pidname = argv[arg++]; } + else if(!strcmp("--logfile", argv[arg])) { + arg++; + if(argc>arg) + serverlogfile = argv[arg++]; + } + else if(!strcmp("--ipv4", argv[arg])) { +#ifdef ENABLE_IPV6 + ipv_inuse = "IPv4"; + use_ipv6 = FALSE; +#endif + arg++; + } else if(!strcmp("--ipv6", argv[arg])) { #ifdef ENABLE_IPV6 ipv_inuse = "IPv6"; @@ -689,13 +701,30 @@ int main(int argc, char **argv) #endif arg++; } - else if(argc>arg) { - - if(atoi(argv[arg])) - port = (unsigned short)atoi(argv[arg++]); - - if(argc>arg) - path = argv[arg++]; + else if(!strcmp("--port", argv[arg])) { + arg++; + if(argc>arg) { + port = (unsigned short)atoi(argv[arg]); + arg++; + } + } + else if(!strcmp("--srcdir", argv[arg])) { + arg++; + if(argc>arg) { + path = argv[arg]; + arg++; + } + } + else { + puts("Usage: tftpd [option]\n" + " --version\n" + " --logfile [file]\n" + " --pidfile [file]\n" + " --ipv4\n" + " --ipv6\n" + " --port [port]\n" + " --srcdir [path]\n"); + return 0; } } |