From a08bd72e917f0fc34615d91fff047b8a215d5e46 Mon Sep 17 00:00:00 2001 From: sabetts Date: Sun, 13 Apr 2003 23:59:53 +0000 Subject: (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. --- ChangeLog | 6 ++++++ NEWS | 4 ++++ doc/ratpoison.texi | 3 +++ src/main.c | 10 ++++++++-- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bc40433..9b1a6aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2003-04-13 Shawn Betts + * src/main.c (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. + * src/manage.c (get_wmname): add debugging output to print returned elements from X11 call. diff --git a/NEWS b/NEWS index b487346..bf7171c 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,9 @@ ratpoison NEWS --- history of user-visible changes. -*- outline -*- +* Changes since 1.2.0-beta3 +** new command line argument --display +Now you can specify the display to connect to. + * Changes since 1.2.0-beta2 * Changes since 1.1.1 diff --git a/doc/ratpoison.texi b/doc/ratpoison.texi index bfdcb49..dee39a1 100644 --- a/doc/ratpoison.texi +++ b/doc/ratpoison.texi @@ -880,6 +880,9 @@ Display this help screen @item -v, --version Display the version +@item -d, --display +Specify the X display to connect to. + @item -c, --command Send ratpoison a colon-command. This allows you to control ratpoison from the command-line. with the @option{-c} option you can script diff --git a/src/main.c b/src/main.c index 71189f5..8994e8c 100644 --- a/src/main.c +++ b/src/main.c @@ -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 Set the X display to use\n"); + printf ("-c, --command 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; -- cgit v1.2.3