From 6ae989fdeeeb3fe1d543925b5a396c4a77c39171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedrich=20Scho=CC=88ller?= Date: Thu, 11 May 2017 22:45:59 +0200 Subject: [PATCH] Print nicer usage text --- src/main.cpp | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 8d35b35..2e53f3f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -60,27 +60,33 @@ static void usage() { printf( "Hans - IP over ICMP version 1.0\n\n" - "RUN AS SERVER\n" - " hans -s network [-fvr] [-p password] [-u unprivileged_user] [-d tun_device] [-m reference_mtu] [-a ip]\n\n" "RUN AS CLIENT\n" - " hans -c server [-fv] [-p password] [-u unprivileged_user] [-d tun_device] [-m reference_mtu] [-w polls]\n\n" + " hans -c server [-fv] [-p passphrase] [-u user] [-d tun_device]\n" + " [-m reference_mtu] [-w polls]\n\n" + "RUN AS SERVER (linux only)\n" + " hans -s network [-fvr] [-p passphrase] [-u user] [-d tun_device]\n" + " [-m reference_mtu] [-a ip]\n\n" "ARGUMENTS\n" - " -s network Run as a server with the given network address for the virtual interface. Linux only!\n" - " -c server Connect to a server.\n" + " -c server Run as client. Connect to given server address.\n" + " -s network Run as server. Use given network address on virtual interfaces.\n" + " -p passphrase Set passphrase.\n" + " -u username Change user under which the program runs.\n" + " -a ip Request assignment of given tunnel ip address from the server.\n" + " -r Respond to ordinary pings in server mode.\n" + " -d device Use given tun device.\n" + " -m mtu Set maximum echo packet size. This should correspond to the MTU\n" + " of the network between client and server, which is usually 1500\n" + " over Ethernet. Has to be the same on client and server. Defaults\n" + " to 1500.\n" + " -w polls Number of echo requests the client sends in advance for the\n" + " server to reply to. 0 disables polling, which is the best choice\n" + " if the network allows unlimited echo replies. Defaults to 10.\n" + " -i Change echo id on every echo request. May help with buggy\n" + " routers. May impact performance with others.\n" + " -q Change echo sequence number on every echo request. May help with\n" + " buggy routers. May impact performance with others.\n" " -f Run in foreground.\n" " -v Print debug information.\n" - " -r Respond to ordinary pings. Only in server mode.\n" - " -p password Use a password.\n" - " -u username Set the user under which the program should run.\n" - " -d device Use the given tun device.\n" - " -m mtu Use this mtu to calculate the tunnel mtu.\n" - " The generated echo packets will not be bigger than this value.\n" - " Has to be the same on client and server. Defaults to 1500.\n" - " -w polls Number of echo requests the client sends to the server for polling.\n" - " 0 disables polling. Defaults to 10.\n" - " -i Change the echo id for every echo request.\n" - " -q Change the echo sequence number for every echo request.\n" - " -a ip Try to get assigned the given tunnel ip address.\n" ); }