help-gengetopt
[Top][All Lists]
Advanced

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

Re: [help-gengetopt] gengetopt 2.22b-2 beta issues


From: Lorenzo Bettini
Subject: Re: [help-gengetopt] gengetopt 2.22b-2 beta issues
Date: Sun, 23 Dec 2007 15:41:33 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20071022)

Papp Gyozo (VBuster) wrote:
I was considering to post the .ggo file but it is a little big about
~60 options and several sections, so at first I intentionally skipped
it. However, the problem still exists (hope no) I'll send you. Be
sure!
oh, then I'd really need an input file to reproduce the problem... if you can reproduce it in a smaller file that'd be even better :-)

still quite strange. gengetopt 2.22b-3 is likely to crash on the attached .ggo 
file on Windows. The tarball was downloaded and built yesterday with MinGW not 
Cygwin to get a native Windows binary.


Hi

I think I found the problem (well, at least this was a bug) in the loop for creating the help string.

it's just a simple patch I attach (if there are problems, I can provide a .tar.gz, it's not in the cvs yet).

Now the --help and --full-help output look ok to me (see the attached files).

hope to hear from you soon
cheers
        Lorenzo
Index: src/gm.cc
===================================================================
RCS file: /home/bettini/work/cvsroot/gengetopt/src/gm.cc,v
retrieving revision 1.117.2.29
diff -u -r1.117.2.29 gm.cc
--- src/gm.cc   13 Dec 2007 09:54:26 -0000      1.117.2.29
+++ src/gm.cc   23 Dec 2007 14:27:54 -0000
@@ -762,7 +762,7 @@
     OptionHelpList::const_iterator it = option_list->begin();
     OptionHelpList::const_iterator it2 = full_option_list->begin();
     // the second list is surely longer so we scan that one
-    for (; it2 != full_option_list->end(); ++it2)
+    for (; it != option_list->end() && it2 != full_option_list->end(); ++it2)
     {
         if (*it == *it2) {
             // when the two strings are the same it means that's a non-hidden
foo 1.0

Usage: foo [OPTIONS]...

  -h, --help                   Print help and exit
      --full-help              Print help, including hidden options, and exit
  -V, --version                Print version and exit

Registration:
  
  You have to wait 30 seconds after program start without valid registration!

  -k, --registration-key=KEY   registration key from the licence agreement.
  -u, --registered-user=NAME   username to whom the licence agreement is filled 
                                 out.

Targets to be scanned:
  -f, --file=FILE              obtains targets to be scanned from FILE or from 
                                 the standard input if FILE is '-' (available 
                                 in automatic mode only)
  -Z, --skip-archive           disables scanning inside compressed files.  
                                 (default=off)
  -R, --skip-subdir[=PATTERN]  skips all or the specified subdirectories under 
                                 TARGETS.

 Group: Pathname patterns
  
  By default, filesnames matching a scanengine pattern shall be scanned only. 
  This behaviour can be altered with the following options. Multiple patterns 
  can be given in PATTERN separated by '|'.

      --all-files              no matching at all, each file will be scanned.

Scanning methods and operation:
  -s, --scanning=LEVEL         adjust scanning method level  (possible 
                                 values="quick", "strict", "full" 
                                 default=`strict')
  -e, --heuristics=LEVEL       adjust heuristic examination level  (possible 
                                 values="off", "normal", "high" 
                                 default=`normal')
  -A, --autoscan               automatically scan packed samples internally.  
                                 (default=on)
  -G, --greyware               enables greyware detection detection.  
                                 (default=off)
  -a, --action=ACTION          action to be taken automatically on virus alert.

                                 More than one action can be specified, and in 
                                 such cases, the first available action will be 
                                 taken.

                                 If this option is not specified at all, user 
                                 is asked on each alert.  (possible 
                                 values="delete", "kill", "quarantine", 
                                 "rename", "skip")

Working files and directories:
  
  Non-absolute pathnames are relative to the executable's directory.

  -d, --vdb=FILE               XML descrtiptor file with the list of virus 
                                 database files.  (default=`vdb\\vdb.xml')

 Group: lib
  -E, --engine=FILE            load and use FILE as the scan engine shared 
                                 library.

Diagnostic settings:
  
  Non-absolute pathnames are relative to the current directory.

  -q, --quiet                  do not print filenames except from virus alert 
                                 (brief mode). Doubling it (`-qq') suppresses 
                                 all messages but virus alerts (quiet mode), 
                                 and `-qqq' implies `--terse' as well. Note 
                                 that this flag does not affect error reporting 
                                 on stderr!
  -c, --config=CONFIG          obtain missing options from CONFIG file. The 
                                 commandline options take precedence over their 
                                 equivalents given in config file.  
                                 (default=`vbscan.ini')
      --log[=FILE]             file where to save messages for further use.  
                                 (default=`vbscan.log')
foo 1.0

Usage: foo [OPTIONS]...

  -h, --help                   Print help and exit
      --full-help              Print help, including hidden options, and exit
  -V, --version                Print version and exit

Registration:
  
  You have to wait 30 seconds after program start without valid registration!

  -k, --registration-key=KEY   registration key from the licence agreement.
  -u, --registered-user=NAME   username to whom the licence agreement is filled 
                                 out.

Targets to be scanned:
  -b, --boot                   enables scanning of boot sectors of attached 
                                 devices, too. This option works on Windows/DOS 
                                 only.  (default=off)
  -f, --file=FILE              obtains targets to be scanned from FILE or from 
                                 the standard input if FILE is '-' (available 
                                 in automatic mode only)
  -Z, --skip-archive           disables scanning inside compressed files.  
                                 (default=off)
  -M, --skip-mail              disables scanning inside mail files (MIME).  
                                 (default=off)
  -R, --skip-subdir[=PATTERN]  skips all or the specified subdirectories under 
                                 TARGETS.
      --symlink=ACTION         how to handle symbolic links. It influences 
                                 pattern matching: 'follow' uses the link name 
                                 while 'resolve' does the linked file name 
                                 instead.

                                        It has no effect on Windows and DOS.  
                                 (possible values="skip", "follow", 
                                 "resolve" default=`skip')

 Group: Pathname patterns
  
  By default, filesnames matching a scanengine pattern shall be scanned only. 
  This behaviour can be altered with the following options. Multiple patterns 
  can be given in PATTERN separated by '|'.

      --all-files              no matching at all, each file will be scanned.
  -p, --pattern=PATTERN        uses PATTERN in place of the default 
                                 configuration.
      --include=PATTERN        adds PATTERN to the default configuration.
      --exclude=PATTERN        excludes files with basename matching PATTERN. 
                                 This option can be used along with any pattern 
                                 configuration described above.
  -m, --match-in-archive       toggles basename pattern matching on files 
                                 inside archives and mails. `--pattern' turns 
                                 its default value to 'off' implicitly.  
                                 (default=on)

Scanning methods and operation:
  -s, --scanning=LEVEL         adjust scanning method level  (possible 
                                 values="quick", "strict", "full" 
                                 default=`strict')
  -e, --heuristics=LEVEL       adjust heuristic examination level  (possible 
                                 values="off", "normal", "high" 
                                 default=`normal')
      --sfx                    enables SFX (self-extractor) detection.  
                                 (default=on)
  -A, --autoscan               automatically scan packed samples internally.  
                                 (default=on)
  -G, --greyware               enables greyware detection detection.  
                                 (default=off)
  -a, --action=ACTION          action to be taken automatically on virus alert.

                                 More than one action can be specified, and in 
                                 such cases, the first available action will be 
                                 taken.

                                 If this option is not specified at all, user 
                                 is asked on each alert.  (possible 
                                 values="delete", "kill", "quarantine", 
                                 "rename", "skip")
      --remove-macro           automatically removes all macros from `Office' 
                                 documents.  (default=off)
      --thread=NUM             maximum number of scanning threads.
                                 This option has no effect on DOS.  
                                 (default=`1')
      --timeout=NUM            number of seconds within a thread should finish 
                                 the scanning of one object. Consider to raise 
                                 this limit in case of huge archive files.  
                                 (default=`120')
      --memory=MODE            scan engine memory consumption  (possible 
                                 values="normal", "minimum", "full" 
                                 default=`full')
      --timeout-abort          exits when the first thread is timed out.  
                                 (default=off)
      --archive-max-size=NUM   maximum decompression size in MBytes. (0 means 
                                 engine default.)  (default=`0')
      --archive-max-ratio=NUM  maximum decompression ratio in MBytes. (0 means 
                                 engine default.)  (default=`0')

Quarantine operations:
  The following actions accept zero or more arguments (`keys' or `key:FILE' 
  pairs) specifying the operands for the desired operation. Multiple actions 
  with arguments are permitted, and the keys can be obtained by `--list'.
  If no key is given at all, the selected action is performed on each file in 
  the quarantine. Files can be filtered by `--status' in both cases.

      --status=STATUS          quarantine files with STATUS will be selected 
                                 only for the desired operation.
                                 The default values are 'all', 'infected' and 
                                 `clean' for `--list', `--delete' and 
                                 '--restore', respectively.  (possible 
                                 values="all", "clean", "infected", 
                                 "suspicious", "deleted")
  -l, --list[=key]             displays information about quarantined file(s)  
                                 in quarantine directory (`--quarantine') such 
                                 as 'key' and STATUS beside original location, 
                                 file size and last modification date.
      --delete[=key]           deletes quarantined file(s).
      --rescan[=key]           rescans quarantined file(s).
                                 `--status' has no effect on this operation.
      --restore[=key[:FILE]]   restores quarantined file(s) to FILE or its 
                                 original location if FILE is omitted.
      --saveas=key:FILE        saves quarantined file(s) specified by key 
                                 (required!) to FILE(s).
  -w, --overwrite              allows for `--restore' and `--saveas' to 
                                 overwrite existing FILE(s).  (default=off)

Working files and directories:
  
  Non-absolute pathnames are relative to the executable's directory.

  -y, --quarantine=DIR         secure directory where to move infected files.
  -t, --temp=DIR               directory for temporary file actions.
  -d, --vdb=FILE               XML descrtiptor file with the list of virus 
                                 database files.  (default=`vdb\\vdb.xml')
  -O, --optional=STRING        optional virus database files to load beside 
                                 default ones.

 Group: lib
  -E, --engine=FILE            load and use FILE as the scan engine shared 
                                 library.

Diagnostic settings:
  
  Non-absolute pathnames are relative to the current directory.

  -o, --old                    do not warn if VDB is older than two weeks.
  -q, --quiet                  do not print filenames except from virus alert 
                                 (brief mode). Doubling it (`-qq') suppresses 
                                 all messages but virus alerts (quiet mode), 
                                 and `-qqq' implies `--terse' as well. Note 
                                 that this flag does not affect error reporting 
                                 on stderr!
      --summary                toggles displaying of summary results. It is on 
                                 by default, but quiet mode implicitly turns 
                                 off.  (default=on)
  -T, --terse                  use terse message format in automatic mode. 
                                 `--quiet' may override.
  -C, --show-config            dump the actual settings to the stdout, and 
                                 exit.  (default=off)
  -c, --config=CONFIG          obtain missing options from CONFIG file. The 
                                 commandline options take precedence over their 
                                 equivalents given in config file.  
                                 (default=`vbscan.ini')
      --log[=FILE]             file where to save messages for further use.  
                                 (default=`vbscan.log')
  -g, --debug=FILE             logs XEDK messages as described in FILE.

reply via email to

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