lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev Command-line options and DOS [patch]


From: Doug Kaufman
Subject: lynx-dev Command-line options and DOS [patch]
Date: Sat, 31 Jul 1999 17:36:46 -0700 (PDT)

I noticed a few anomalies in reviewing the command-line options.
Although we added the functionality of specifying toggles on or off
via the -option[+-] or -option=[off on] syntax, I couldn't find this
in the users guide or man pages. This seems to work as expected
when the initial boolean value is FALSE. When the initial value is
TRUE, this can give unexpected results (e.g. -show_cursor shows the
cursor only when -showcursor=off). There is also a problem under
DOS, in that lynx is usually run from a batch file, with options
passes as "replaceable parameters" by the operating system. DOS uses
"=" as a non-configurable separator for options. Thus if the option
"-show_cursor=off" is given, the operating system passes to lynx
"-show_cursor off". Lynx dutifully tries to open the startfile "off".

I propose a few changes to improve this. Firstly, I added the value
":" as a separator between the option and its value. This makes it
much easier under DOS. I didn't see where it would adversely impact
other systems. If it does, it can be ifdef'd to __DJGPP__. Changes to
lynx.man, lynx.hlp, and the lynx users guide are proposed. I deleted
the statement that white space can be substituted for "=" in the
command line options, since it doesn't always appear to be true (it
does work for -cfg). I didn't change the default boolean values that
start TRUE. We probably need to look at each one individually and see
if it give the expected function when [on off + -] are specified.

I also added a new command line toggle for DOS to control debugging
of packets under WATTCP and WATT-32. Under WATT-32, once dbug_init
is called, debugging can not be turned off (although output can be
sent to /dev/null). This new option "-wdebug" will control whether
debugging is active. It will be off by default. This is modified from
code originally suggested by Gisle Vanem.

Patch against dev.5.

                              Doug


--- lynx2-8-3/src/LYMain.c      Fri Jul 30 08:39:54 1999
+++ lynx2-8-3/src/LYMain.c.new  Sat Jul 31 17:05:00 1999
@@ -276,6 +276,9 @@
 PUBLIC BOOLEAN override_no_download = FALSE;
 PUBLIC BOOLEAN show_dotfiles = FALSE; /* From rcfile if no_dotfiles is false */
 PUBLIC BOOLEAN LYforce_HTML_mode = FALSE;
+#ifdef __DJGPP__
+PUBLIC BOOLEAN watt_debug = FALSE;  /* WATT-32 debugging */
+#endif /* __DJGPP__ */
 
 #ifdef WIN_EX
 #undef SYSTEM_MAIL
@@ -823,10 +826,18 @@
        init_ctrl_break[0] = 1;
     }
     atexit(reset_break);
-    dbug_init();
+    for (i = 1; i < argc; i++) {
+       if (argncmp(argv[i], "-wdebug") == 0) {
+           parse_arg(&argv[i], &i);
+       }
+    }
+    if (watt_debug)
+    {
+      dbug_init();
+    }
     sock_init();
     __system_flags = 0x501D;
-#endif
+#endif /* __DJGPP__ */
 
     /*
      * To prevent corrupting binary data on DOS, MS-WINDOWS or OS/2
@@ -1078,7 +1089,7 @@
            socks_flag = FALSE;
 #endif /* SOCKS */
        } else if (argncmp(argv[i], "-cfg") == 0) {
-           if ((cp=strchr(argv[i],'=')) != NULL)
+           if (((cp=strchr(argv[i],'=')) != NULL) || ((cp=strchr(argv[i],':')) 
!= NULL))
                StrAllocCopy(lynx_cfg_file, cp+1);
            else {
                StrAllocCopy(lynx_cfg_file, argv[i+1]);
@@ -3351,6 +3362,12 @@
       "vikeys",                SET_ARG,                &vi_keys,
       "enable vi-like key movement"
    ),
+#ifdef __DJGPP__
+   PARSE_SET(
+     "wdebug",         TOGGLE_ARG,             &watt_debug,
+     "enables Waterloo tcp/ip packet debug. Prints to watt debugfile"
+  ),
+#endif /* __DJGPP__ */
    PARSE_FUN(
       "width",         NEED_FUNCTION_ARG,      width_fun,
       "=NUMBER\nscreen width for formatting of dumps (default is 80)"
@@ -3485,6 +3502,7 @@
            if (*a == 0) {
                switch (*b) {
                case '=':
+               case ':':
                    *c = b + 1;
                    return 1;
                case '-':       /* FALLTHRU */
--- lynx2-8-3/lynx.hlp  Fri Jul 30 08:39:54 1999
+++ lynx2-8-3/lynx.hlp.new      Fri Jul 30 23:36:44 1999
@@ -567,7 +567,7 @@
               security restrictions also are implemented.
 
        -verbose
-              taggles  [LINK], [IMAGE] and [INLINE] comments with
+              toggle  [LINK], [IMAGE] and [INLINE] comments with
               filenames of these images.
 
        -version
@@ -575,6 +575,11 @@
 
        -vikeys
               enable vi-like key movement.
+
+       -wdebug
+              enable Waterloo tcp/ip packet debug (print to  watt
+              debugfile).  This applies only to DOS versions com-
+              piled with WATTCP or WATT-32.
 
        -width=NUMBER
               number of columns for formatting of dumps,  default
--- lynx2-8-3/lynx.man  Fri Jul 30 08:39:54 1999
+++ lynx2-8-3/lynx.man.new      Fri Jul 30 23:36:46 1999
@@ -598,13 +598,17 @@
 restrictions also are implemented.
 .TP
 .B -verbose
-taggles [LINK], [IMAGE] and [INLINE] comments with filenames of these images.
+toggle [LINK], [IMAGE] and [INLINE] comments with filenames of these images.
 .TP
 .B -version
 print version information.
 .TP
 .B -vikeys
 enable vi-like key movement.
+.TP
+.B -wdebug
+enable Waterloo tcp/ip packet debug (print to watt debugfile).
+This applies only to DOS versions compiled with WATTCP or WATT-32.
 .TP
 .B -width\fR=\fINUMBER
 number of columns for formatting of dumps, default is 80.
--- lynx2-8-3/lynx_help/Lynx_users_guide.html   Fri Jul 30 08:39:54 1999
+++ lynx2-8-3/lynx_help/Lynx_users_guide.html.new       Sat Jul 31 16:55:10 1999
@@ -2058,7 +2058,14 @@
          </ul>
    <dt><code>options</code>
        <dd>can be selected from the following list, where items in
-           all-caps indicate that a substitution must be made.
+     all-caps indicate that a substitution must be made. Many options
+     are "toggles", meaning that they will change the default action,
+     however it was specified. To always set the option on, use the
+     syntax "-option+", "-option=on", or "-option:on". To always set
+     the option off, use the syntax "-option-", "-option=off", or
+     "-option:off". The syntax with the "=" may not work under DOS
+     because of operating system constraints. Use one of the other
+     forms in that case.
           <dl>
             <dt><code>-</code>
                <dd>If the argument is only '<code>-</code>' (dash), then Lynx
@@ -2528,8 +2535,7 @@
 </dl>
 
 <p>No options are required, nor is a startfile argument required.
-White space may be substituted for any equal sign ('<em>=</em>')
-appearing in the option list above. [<A HREF="#ToC-Invoking">ToC</A>]
+ [<A HREF="#ToC-Invoking">ToC</A>]
 
 
 <h2 ID="Environments"><A NAME="Environment"><em>Environment variables used by 
Lynx</em></A></h2>

__
Doug Kaufman
Internet: address@hidden (preferred)
          address@hidden


reply via email to

[Prev in Thread] Current Thread [Next in Thread]