diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-04-12 15:09:32 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-04-12 15:09:32 -0700 |
commit | cf28e3bf739cda49e038cd53e8bb241fc1c2e81d (patch) | |
tree | 39c6771cddfcf06d158b96bbbc7ca635c0c8d052 /xstdcmap.c | |
parent | ea263607d3fbe4eca3319a3824c3f641dade4871 (diff) |
Closes: #1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/app/xstdcmap/-/merge_requests/4>
Diffstat (limited to 'xstdcmap.c')
-rw-r--r-- | xstdcmap.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -341,6 +341,22 @@ main(int argc, char *argv[]) else program_name = *argv; + /* Handle args that don't require opening a display or initializing Xrm */ + for (int n = 1; n < argc; n++) { + const char *argn = argv[n]; + /* accept single or double dash for -help & -version */ + if (argn[0] == '-' && argn[1] == '-') { + argn++; + } + if (strcmp(argn, "-help") == 0) { + usage(0); + } + if (strcmp(argn, "-version") == 0) { + puts(PACKAGE_STRING); + exit(0); + } + } + parse(argc, argv); if (help) { |