diff options
author | sabetts <sabetts> | 2003-04-13 23:59:53 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2003-04-13 23:59:53 +0000 |
commit | a08bd72e917f0fc34615d91fff047b8a215d5e46 (patch) | |
tree | 82296ffa0169d7d22d74328d906f11f74c072bb3 /src/main.c | |
parent | 5c9807f849eb0eba01c8c7609346d238f5dac3df (diff) | |
download | ratpoison-a08bd72e917f0fc34615d91fff047b8a215d5e46.zip |
(main): add switch case for the display command line
option.
(print_help): add --display option. Add text to demonstrate
--display and --command take an argument.
(ratpoison_longopts): add display.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -94,6 +94,7 @@ static struct option ratpoison_longopts[] = { {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'v'}, {"command", required_argument, 0, 'c'}, + {"display", required_argument, 0, 'd'}, {0, 0, 0, 0} }; static char ratpoison_opts[] = "hvc:"; @@ -311,7 +312,8 @@ print_help () printf ("Help for %s %s\n\n", PACKAGE, VERSION); printf ("-h, --help Display this help screen\n"); printf ("-v, --version Display the version\n"); - printf ("-c, --command Send ratpoison a colon-command\n\n"); + printf ("-d, --display <dpy> Set the X display to use\n"); + printf ("-c, --command <cmd> Send ratpoison a colon-command\n\n"); printf ("Report bugs to ratpoison-devel@lists.sourceforge.net\n\n"); @@ -498,6 +500,7 @@ main (int argc, char *argv[]) int c; char **command = NULL; int cmd_count = 0; + char *display = NULL; myargv = argv; @@ -531,12 +534,15 @@ main (int argc, char *argv[]) command[cmd_count] = xstrdup (optarg); cmd_count++; break; + case 'd': + display = xstrdup (optarg); + break; default: exit (EXIT_FAILURE); } } - if (!(dpy = XOpenDisplay (NULL))) + if (!(dpy = XOpenDisplay (display))) { fprintf (stderr, "Can't open display\n"); return EXIT_FAILURE; |