Skip to content

Commit

Permalink
src: add basic help option printing usage info
Browse files Browse the repository at this point in the history
Closes #4
  • Loading branch information
bk138 committed Mar 8, 2024
1 parent 633434c commit a14293d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <IOKit/pwr_mgt/IOPM.h>
#include <stdio.h>
#include <pthread.h>
#include <stdlib.h>

/* The main LibVNCServer screen object */
rfbScreenInfoPtr rfbScreen;
Expand Down Expand Up @@ -659,6 +660,11 @@ int main(int argc,char *argv[])
viewOnly=TRUE;
} else if(strcmp(argv[i],"-display")==0) {
displayNumber = atoi(argv[i+1]);
} else if(strcmp(argv[i],"-h") == 0 || strcmp(argv[i],"--help") == 0) {
fprintf(stderr, "-viewonly Do not allow any input\n");
fprintf(stderr, "-display <index> Only export specified display\n");
rfbUsage();
exit(EXIT_SUCCESS);
}

if(!viewOnly && !AXIsProcessTrusted()) {
Expand Down

0 comments on commit a14293d

Please sign in to comment.