diff options
author | GDR! <gdr@gdr.name> | 2017-01-24 20:24:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-24 20:24:43 +0100 |
commit | 4cb9748ac962e2a9554b8a47fbd34dc576fbc8d0 (patch) | |
tree | 3baa4a290357b1f93599981f3c73bfd137f19dae | |
parent | 5b1cad03a674ed6ac41e5e0081a087b99b00aefd (diff) | |
parent | d77375c08113707235fe3949a7020bb87a7fdc41 (diff) |
Merge pull request #37 from fgaz/patch-2
Nicer help message
-rw-r--r-- | main.c | 46 |
1 files changed, 30 insertions, 16 deletions
@@ -1156,22 +1156,36 @@ void do_daemonize() | |||
1156 | 1156 | ||
1157 | void help() | 1157 | void help() |
1158 | { | 1158 | { |
1159 | fprintf(stderr, "tuntox - Forward ports over the Tox protocol\n"); | 1159 | fprintf(stderr, "tuntox - Forward ports over the Tox protocol\n\n"); |
1160 | fprintf(stderr, "USAGE:\n\n"); | 1160 | fprintf(stderr, "Usage:\n"); |
1161 | fprintf(stderr, "-i <toxid> - remote point Tox ID\n"); | 1161 | fprintf(stderr, " tuntox ... # starts the server\n"); |
1162 | fprintf(stderr, "-L <localport>:<remotehostname>:<remoteport> - forward <remotehostname>:<remoteport> to 127.0.0.1:<localport>\n"); | 1162 | fprintf(stderr, " tuntox -i <servertoxid> -L <localport>:<remoteaddress>:<remoteport> ... # starts the client\n\n"); |
1163 | fprintf(stderr, "-P <remotehostname>:<remoteport> - forward <remotehostname>:<remoteport> to stdin/stdout (SSH ProxyCommand mode)\n"); | 1163 | fprintf(stderr, "Options:\n"); |
1164 | fprintf(stderr, "-p - ping the server from -i and exit\n"); | 1164 | fprintf(stderr, " Server:\n"); |
1165 | fprintf(stderr, "-C <dir> - save private key in <dir> instead of /etc/tuntox in server mode\n"); | 1165 | fprintf(stderr, " -i <toxid> - whitelisted Tox ID (can be used multiple times)\n"); |
1166 | fprintf(stderr, "-s <secret> - shared secret used for connection authentication (max %u characters)\n", TOX_MAX_FRIEND_REQUEST_LENGTH-1); | 1166 | fprintf(stderr, " -f <file> - only allow connections to hostname/port combinations contained\n"); |
1167 | fprintf(stderr, "-f <file> - only allow connections to hostname/port combinations contained in <file>. Rules must be entered one per line with the <hostname>:<port> format\n"); | 1167 | fprintf(stderr, " in <file>. Rules must be entered one per line with the\n"); |
1168 | fprintf(stderr, "-d - debug mode\n"); | 1168 | fprintf(stderr, " <hostname>:<port> format\n"); |
1169 | fprintf(stderr, "-q - quiet mode\n"); | 1169 | fprintf(stderr, " Client:\n"); |
1170 | fprintf(stderr, "-S - send output to syslog instead of stderr\n"); | 1170 | fprintf(stderr, " -i <toxid> - remote point Tox ID\n"); |
1171 | fprintf(stderr, "-D - daemonize (fork) and exit (implies -S)\n"); | 1171 | fprintf(stderr, " -L <localport>:<remotehostname>:<remoteport>\n"); |
1172 | fprintf(stderr, "-F <path> - create a PID file named <path>\n"); | 1172 | fprintf(stderr, " - forward <remotehostname>:<remoteport> to 127.0.0.1:<localport>\n"); |
1173 | fprintf(stderr, "-U <username|userid> - drop privileges to <username> before forking. Use numeric <userid> in static builds.\n"); | 1173 | fprintf(stderr, " -P <remotehostname>:<remoteport> - forward <remotehostname>:<remoteport> to\n"); |
1174 | fprintf(stderr, "-h - this help message\n"); | 1174 | fprintf(stderr, " stdin/stdout (SSH ProxyCommand mode)\n"); |
1175 | fprintf(stderr, " -p - ping the server from -i and exit\n"); | ||
1176 | fprintf(stderr, " Common:\n"); | ||
1177 | fprintf(stderr, " -C <dir> - save private key in <dir> instead of /etc/tuntox in server\n"); | ||
1178 | fprintf(stderr, " mode\n"); | ||
1179 | fprintf(stderr, " -s <secret> - shared secret used for connection authentication (max\n"); | ||
1180 | fprintf(stderr, " %u characters)\n", TOX_MAX_FRIEND_REQUEST_LENGTH-1); | ||
1181 | fprintf(stderr, " -d - debug mode\n"); | ||
1182 | fprintf(stderr, " -q - quiet mode\n"); | ||
1183 | fprintf(stderr, " -S - send output to syslog instead of stderr\n"); | ||
1184 | fprintf(stderr, " -D - daemonize (fork) and exit (implies -S)\n"); | ||
1185 | fprintf(stderr, " -F <path> - create a PID file named <path>\n"); | ||
1186 | fprintf(stderr, " -U <username|userid> - drop privileges to <username> before forking. Use\n"); | ||
1187 | fprintf(stderr, " numeric <userid> in static builds.\n"); | ||
1188 | fprintf(stderr, " -h - this help message\n"); | ||
1175 | } | 1189 | } |
1176 | 1190 | ||
1177 | int main(int argc, char *argv[]) | 1191 | int main(int argc, char *argv[]) |