On Fri Oct 31, 2008 at 15:22:47 -0500, David Douthitt wrote:

> One thing that would be a good idea perhaps is a -V option: that is, 
> an option that explains all of the optional parts that have been 
> compiled into screen.

  That's a trivial job, and as you say '-V' is available as a natural
 nmemonic.

  Minimal patch attached which does this for my version of tscreen. 
 Obviously it needs to be updated to handle other things like NETHACK
 and a consensus reached on appropriate formatting.  Still its not
 a major change.

  Sample output:

[EMAIL PROTECTED]:~/hg/tscreen$ ./tscreen -V
tscreen version 0.04.08skx (FORK) 31-10-2008

http://www.steve.org.uk/Software/tscreen/
Compilation Options

+ALLOW_SYSSCREENRC
-BUILTIN_TELNET
+CHECKLOGIN
+DETACH
-HAVE_BRAILE
+LOADAV
-LOCKPTY
-USE_PAM

Hardwired options

    MAXWIN: 100
    MAX_USERNAME_LEN: 50
    SOCKDIR: /tmp/screens
    TTYVMIN: 100
    TTYVTIME: 2

Steve
-- 
# Commercial Debian GNU/Linux Support
http://www.linux-administration.org/

diff -r 9326bb6bbc4b screen.c
--- a/screen.c	Sat Nov 01 14:19:21 2008 +0000
+++ b/screen.c	Sat Nov 01 16:48:30 2008 +0000
@@ -150,6 +150,7 @@
 static char *ParseChar __P((char *, char *));
 static int   ParseEscape __P((char *));
 static char *pad_expand __P((char *, char *, int, int));
+static void  showCompiledConfig();
 #ifdef DEBUG
 static void  fds __P((void));
 #endif
@@ -725,6 +726,9 @@
 		case 'X':
 		  cmdflag = 1;
 		  break;
+                case 'V':
+                  showCompiledConfig();
+                  break;  /* NOTREACHED */
 		case 'v':
 		  Panic(0, "tscreen version %s", version);
 		  /* NOTREACHED */
@@ -3340,3 +3344,70 @@
   return 0;
 }
 
+
+
+static void
+showCompiledConfig()
+{
+  printf( "tscreen version %s\n\n", version );
+  printf( "http://www.steve.org.uk/Software/tscreen/\n"; );
+
+  printf( "Compilation Options\n\n" );
+
+#ifdef ALLOW_SYSSCREENRC
+  printf( "+ALLOW_SYSSCREENRC\n" );
+#else
+  printf( "-ALLOW_SYSSCREENRC\n" );
+#endif
+
+#ifdef BULTIN_TELNET
+  printf( "+BUILTIN_TELNET\n" );
+#else
+  printf( "-BUILTIN_TELNET\n" );
+#endif
+
+#ifdef CHECKLOGIN
+  printf( "+CHECKLOGIN\n" );
+#else
+  printf( "-CHECKLOGIN\n" );
+#endif
+
+#ifdef DETACH
+  printf( "+DETACH\n" );
+#else
+  printf( "-DETACH\n" );
+#endif
+
+#ifdef HAVE_BRAILE
+  printf( "+HAVE_BRAILE\n" );
+#else
+  printf( "-HAVE_BRAILE\n" );
+#endif
+
+#ifdef LOADAV
+  printf( "+LOADAV\n" );
+#else
+  printf( "-LOADAV\n" );
+#endif
+
+#ifdef LOCKPTY
+  printf( "+LOCKPTY\n" );
+#else
+  printf( "-LOCKPTY\n" );
+#endif
+
+#ifdef USE_PAM
+  printf( "+USE_PAM\n" );
+#else
+  printf( "-USE_PAM\n" );
+#endif
+
+  printf( "\nHardwired options\n\n" );
+  printf( "\tMAXWIN: %d\n", MAXWIN );
+  printf( "\tMAX_USERNAME_LEN: %d\n", MAX_USERNAME_LEN );
+  printf( "\tSOCKDIR: %s\n", SOCKDIR );
+  printf( "\tTTYVMIN: %d\n", TTYVMIN );
+  printf( "\tTTYVTIME: %d\n", TTYVTIME );
+
+  exit(0);
+}

Reply via email to