tools/hexnet: replace "server" with "listen" because that's what netcat calls it and the argument we use is -l like netcat's listen mode
parent
9639ef065f
commit
5cb1a52ec4
|
@ -32,7 +32,7 @@ int main(int argc, char* argv[]){
|
|||
bool ipv6 = true;
|
||||
bool tcp = true;
|
||||
bool udp = true;
|
||||
bool server = false;
|
||||
bool listen = false;
|
||||
std::string host = "";
|
||||
uint16_t port;
|
||||
if (argc<2) {
|
||||
|
@ -62,7 +62,7 @@ int main(int argc, char* argv[]){
|
|||
continue;
|
||||
}
|
||||
if (argument=="-l") {
|
||||
server = true;
|
||||
listen = true;
|
||||
continue;
|
||||
}
|
||||
if (argument=="-h") {
|
||||
|
@ -73,11 +73,11 @@ int main(int argc, char* argv[]){
|
|||
usage;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
if (!server && i==argc-2) {
|
||||
if (!listen && i==argc-2) {
|
||||
host = argument;
|
||||
}
|
||||
if (i==argc-1) {
|
||||
if (!server && host=="") {
|
||||
if (!listen && host=="") {
|
||||
std::cerr << "Not running in listen mode and no host specified." << std::endl;
|
||||
return EXIT_USAGE;
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ int main(int argc, char* argv[]){
|
|||
}
|
||||
// Argument parsing end ############################################
|
||||
|
||||
if (!server) {
|
||||
if (!listen) {
|
||||
//TODO: verify that host is possibly a valid host (or usage error)
|
||||
//TODO: look up host if necessary, determine IPv4 or IPv6 mode if necessary
|
||||
std::cerr << "Client mode not implemented" << std::endl;
|
||||
|
|
Loading…
Reference in New Issue