getopt-long: arg parsing errors cause print and exit, not backtrace
authorAndy Wingo <wingo@pobox.com>
Thu, 10 Feb 2011 11:09:18 +0000 (12:09 +0100)
committerAndy Wingo <wingo@pobox.com>
Thu, 10 Feb 2011 11:17:23 +0000 (12:17 +0100)
commit0bc86fcedcd19a1a388faa6505f822d57a30584c
tree92c306d3653c94179c7202791e62e69dc2d647a5
parent13f607c175b7df585a248145dfd7426334630ee7
getopt-long: arg parsing errors cause print and exit, not backtrace

* module/ice-9/getopt-long.scm (fatal-error): New helper.  For errors
  that come from the user -- i.e., not the grammar -- we will handle our
  own error printing and call `exit' rather than relying on the root
  catch handler.  This is more friendly to the user than a Scheme
  backtrace.
  (parse-option-spec, process-options, getopt-long): Call `fatal-error'
  as appropriate.

* test-suite/tests/getopt-long.test (pass-if-fatal-exception): New
  helper, checks that a certain key was thrown to, and that suitable
  output has been printed on an error port.
  (deferr): Change to expect a 'quit key instead of 'misc-error.  Update
  exceptions to not match the beginning of the string, as that will be
  the program name.  Update tests to use pass-if-fatal-exception.
module/ice-9/getopt-long.scm
test-suite/tests/getopt-long.test