Hello, I always found that having the toggle options' current
settings and their meanings on one line would be much easier to
read. Now I finally changed it, and maybe you like it, too. However,
it was so easy, so you may have a reason for not doing it this way. It
even is a whole function shorter.

I was not so sure what do with the other options, as some of them have
really long values. So I left them as they are, and only added a
'-'-sign in front of them in the place where they are explained, for a
uniformer looking.

This means it looks like this:

Prelude> :s
TOGGLES: groups begin with +/- to turn options on/off resp.
-s    Print no. reductions/cells after eval
-t    Print type after evaluation
+f    Terminate evaluation on first error
-g    Print no. cells recovered after gc
-l    Literate modules as default
+e    Warn about errors in literate modules
-.    Print dots to show progress
+w    Always show which modules are loaded
-k    Show kind errors in full
+u    Use "show" to display results
+i    Chase imports while loading modules

OTHER OPTIONS: (leading + or - makes no difference)
-hnum Set heap size (cannot be changed within Hugs)
-pstr Set prompt string to str
-rstr Set repeat last expression string to str
-Pstr Set search path for modules to str
-Estr Use editor setting given by str

Current settings: -h100000 -p"%s> " -r"$$"
Search path     : -P"{Hugs}/lib:{Hugs}/lib/hugs:{Hugs}/lib/ghc:{Hugs}/lib/glaExts"
Editor setting  : -E

And this is the patch:

*** hugs.c.org  Mon Aug  4 17:01:16 1997
--- hugs.c      Mon Aug  4 17:05:39 1997
***************
*** 55,61 ****
  static Void   local listNames         Args((Void));
  
  static Void   local toggleSet         Args((Char,Bool));
- static Void   local togglesIn         Args((Bool));
  static Void   local optionInfo        Args((Void));
  #if USE_REGISTRY || HUGS_FOR_WINDOWS
  static String local optionsToStr      Args((Void));
--- 55,60 ----
***************
*** 261,289 ****
      EEND;
  }
  
- static Void local togglesIn(state)      /* Print current list of toggles in*/
- Bool state; {                           /* given state                     */
-     Int count = 0;
-     Int i;
-     for (i=0; toggle[i].c; ++i)
-         if (*toggle[i].flag == state) {
-             if (count==0)
-                 Putchar((char)(state ? '+' : '-'));
-             Putchar(toggle[i].c);
-             count++;
-         }
-     if (count>0)
-         Putchar(' ');
- }
- 
  static Void local optionInfo() {        /* Print information about command */
!     static String fmts = "%-5s%s\n";    /* line settings                   */
!     static String fmtc = "%-5c%s\n";
      Int    i;
  
      Printf("TOGGLES: groups begin with +/- to turn options on/off resp.\n");
      for (i=0; toggle[i].c; ++i)
!         Printf(fmtc,toggle[i].c,toggle[i].description);
  
      Printf("\nOTHER OPTIONS: (leading + or - makes no difference)\n");
      Printf(fmts,"hnum","Set heap size (cannot be changed within Hugs)");
--- 260,275 ----
      EEND;
  }
  
  static Void local optionInfo() {        /* Print information about command */
!     static String fmts =  "-%-5s%s\n";  /* line settings                   */
!     static String fmtc = "%c%-5c%s\n";
      Int    i;
  
      Printf("TOGGLES: groups begin with +/- to turn options on/off resp.\n");
      for (i=0; toggle[i].c; ++i)
!         Printf(fmtc, *toggle[i].flag ? '+' : '-',
!                       toggle[i].c,
!                       toggle[i].description);
  
      Printf("\nOTHER OPTIONS: (leading + or - makes no difference)\n");
      Printf(fmts,"hnum","Set heap size (cannot be changed within Hugs)");
***************
*** 296,303 ****
  #endif
  
      Printf("\nCurrent settings: ");
-     togglesIn(TRUE);
-     togglesIn(FALSE);
      Printf("-h%d",heapSize);
      Printf(" -p");
      printString(prompt);
--- 282,287 ----


Christian Sievers

Reply via email to