[PATCH:xscope 19/24] Add -I command line flag to enter interactive mode at startup

Alan Coopersmith alan.coopersmith at oracle.com
Fri Aug 31 22:18:01 PDT 2012


Avoids having to try to time a ^C after the signal handler is set up
but before any data is handled.

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 man/xscope.man |    9 +++++++--
 scope.c        |    5 +++++
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/man/xscope.man b/man/xscope.man
index f6ae899..d97790a 100644
--- a/man/xscope.man
+++ b/man/xscope.man
@@ -6,7 +6,7 @@ xscope - X Window Protocol Viewer
 [\fB-i\fP\fI<in-port>\fP] [\fB-o\fP\fI<out-port>\fP]
 [\fB-h\fP\fI<server-host>\fP] [\fB-d\fP\fI<display-number>\fP]
 [\fB-q\fP] [\fB-v\fP\fI<n>\fP] [\fB-r\fP]
-[\fB-D\fP\fI<debug-level>\fP] [\fB-S\fP\fI<n>\fP] [\fB-t\fP]
+[\fB-D\fP\fI<debug-level>\fP] [-I] [\fB-S\fP\fI<n>\fP] [\fB-t\fP]
 .SH DESCRIPTION
 .I Xscope
 sits in-between an X11 client and an X11 server and prints the contents
@@ -81,6 +81,10 @@ Print only raw data without decoding it.
 Print debugging information at the specified level.
 .PP
 .TP 10
+.BI -I
+Enter interactive mode at startup.
+.PP
+.TP 10
 .BI -S <n>
 Toggle output on or off when SIGUSR1 is received.  If \fIn\fP is 0,
 the initial state is off.  If \fIn\fP is 1, the initial state is on.
@@ -91,7 +95,8 @@ Terminate \fIxscope\fP when all clients close.
 .SH INTERACTIVE MODE
 .PP
 When \fBxscope\fP receives an interrupt signal (normally generated by
-Control-C) it enters an interactive mode in which it prompts for commands.
+Control-C) or is started with the -I flag, it enters an interactive mode
+in which it prompts for commands.
 Available commands in this mode are:
 .TP 10
 .B audio, a
diff --git a/scope.c b/scope.c
index f3574cc..9b767ab 100644
--- a/scope.c
+++ b/scope.c
@@ -661,6 +661,7 @@ Usage(void)
             "              [-a<n>]  -- audio verbose output\n"
             "              [-q]  -- quiet output\n"
             "              [-D<debug-level>]\n"
+            "              [-I]  -- start in interactive mode\n"
             "              [-S<n>] -- start/stop on SIGUSR1\n"
             "              [-t]  -- terminate when all clients close\n");
     exit(1);
@@ -710,6 +711,10 @@ ScanArgs(int argc, char **argv)
                 debug(1, (stderr, "debuglevel = %d\n", debuglevel));
                 break;
 
+            case 'I':
+                Interrupt = 1;
+                break;
+
             case 'S':
                 HandleSIGUSR1 = 1;
                 ScopeEnabled = atoi(++*argv);
-- 
1.7.9.2



More information about the xorg-devel mailing list