X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=flags.cpp;h=4c7537093982671a4775f0b20d7bd7b7c6d0b569;hb=3795723be95f2fe82f3c8b8b45b1a905b2c811fd;hp=1a4c08e5bfc25cbfb37324ebb048594751f35f8f;hpb=823d581cb58691b91e1109203349fb7a7cdc50e0;p=nageru diff --git a/flags.cpp b/flags.cpp index 1a4c08e..4c75370 100644 --- a/flags.cpp +++ b/flags.cpp @@ -14,7 +14,8 @@ Flags global_flags; // Long options that have no corresponding short option. enum LongOption { OPTION_HELP = 1000, - OPTION_SLOW_DOWN_INPUT = 1001 + OPTION_SLOW_DOWN_INPUT = 1001, + OPTION_HTTP_PORT = 1002 }; void usage() @@ -29,6 +30,7 @@ void usage() fprintf(stderr, " 3 = good (realtime 720p on GTX 970 or so)\n"); fprintf(stderr, " 4 = best (not realtime on any current GPU)\n"); fprintf(stderr, " -d, --working-directory DIR where to store frames and database\n"); + fprintf(stderr, " --http-port PORT which port to listen on for output\n"); } void parse_flags(int argc, char * const argv[]) @@ -38,6 +40,7 @@ void parse_flags(int argc, char * const argv[]) { "slow-down-input", no_argument, 0, OPTION_SLOW_DOWN_INPUT }, { "interpolation-quality", required_argument, 0, 'q' }, { "working-directory", required_argument, 0, 'd' }, + { "http-port", required_argument, 0, OPTION_HTTP_PORT }, { 0, 0, 0, 0 } }; for ( ;; ) { @@ -57,6 +60,9 @@ void parse_flags(int argc, char * const argv[]) case 'd': global_flags.working_directory = optarg; break; + case OPTION_HTTP_PORT: + global_flags.http_port = atoi(optarg); + break; case OPTION_HELP: usage(); exit(0);