diff options
author | Lieuwe Rooijakkers <lieuwerooijakkers@gmail.com> | 2017-01-20 21:39:25 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-01-20 22:47:42 +0100 |
commit | 0cbc19919b1eff010392b71e9f5f4119ef6da3c7 (patch) | |
tree | faa10af927182fd1361723038c441300972e026b | |
parent | c576c7718385f812ca71d815a12c0a1ebf6c135f (diff) |
show default port in usage
-rw-r--r-- | main.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -16,6 +16,7 @@ #include "tcp.h" #define MAX_LISTEN (128) +#define DEFAULT_PORT (1423) i64 max(i64 a,i64 b){ @@ -406,11 +407,11 @@ void handle_disconnect(Connection *conn){ static void usage(const char *argv0){ - fprintf(stderr,"Usage: %s [-p portnum]\n",argv0); + fprintf(stderr,"Usage: %s [-p portnum=%i]\n",argv0,DEFAULT_PORT); } int main(int argc,char **argv){ - int portnum=1423; + int portnum=DEFAULT_PORT; int c; while((c=getopt(argc,argv,"hp:"))!=-1){ switch(c){ |