diff options
author | Julien Cristau <jcristau@debian.org> | 2011-07-28 20:28:22 +0200 |
---|---|---|
committer | Julien Cristau <jcristau@debian.org> | 2011-07-28 20:28:22 +0200 |
commit | b8747f951cb3652975ce8484aaaddd50247729f7 (patch) | |
tree | ad5bd007792921ed26d9ca5bee871eadea9cc31e /xhost.c | |
parent | 24685cf1a3987a72310b0160b102fef615359731 (diff) |
Move "-help" handling up to before XOpenDisplay
We don't need a display to show the usage message.
X.Org bug#39633 <https://bugs.freedesktop.org/show_bug.cgi?id=39633>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Diffstat (limited to 'xhost.c')
-rw-r--r-- | xhost.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -213,6 +213,11 @@ main(int argc, char *argv[]) ProgramName = argv[0]; + if (argc == 2 && !strcmp(argv[1], "-help")) { + fprintf(stderr, "usage: %s [[+-]hostname ...]\n", argv[0]); + exit(1); + } + if ((dpy = XOpenDisplay(NULL)) == NULL) { fprintf(stderr, "%s: unable to open display \"%s\"\n", ProgramName, XDisplayName (NULL)); @@ -281,11 +286,6 @@ main(int argc, char *argv[]) exit(0); } - if (argc == 2 && !strcmp(argv[1], "-help")) { - fprintf(stderr, "usage: %s [[+-]hostname ...]\n", argv[0]); - exit(1); - } - for (i = 1; i < argc; i++) { arg = argv[i]; if (*arg == '-') { |