This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

getopt-long crashes upon unknown options


This program crashes getopt-long in guile-1.3.4:

(use-modules (ice-9 getopt-long))

(define grammar
  `((verbose (single-char #\v)
	     (required? #f)
	     (value #f))))

;; pass an unknown command-line option `--foo' to getopt-long
(getopt-long '("argv[0]" "--foo") grammar)

guile produces the following error:

guile> (getopt-long '("argv[0]" "--foo") grammar)
/usr/local/share/guile/1.3.4/ice-9/getopt-long.scm:190:16: In procedure error in expression (slib:error (quote option-spec->value-required?) ": bad record" ...):
/usr/local/share/guile/1.3.4/ice-9/getopt-long.scm:190:16: option-spec->value-required? ": bad record" #f
ABORT: (misc-error)

I consider this behavior unacceptable.  getopt-long should either
print an error message stating that the option is unrecognized, or
return some error code to the caller.

Cheers,
Matteo Frigo

P.S.: thanks for your work on guile.  guile has made a lot of progress
since the early days, and now it is quite useful.  I am plannig to
release a guile program for the design of discrete-time filters soon.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]