Menu

#73 getoptions -- help or error?

open
cmdline (12)
5
2001-12-11
2001-10-17
No

In the ::cmdline::getoptions procedure, there is no
way to differentiate between a user who wants help
and passes a -? or -help option, and a user who has
entered an unknown option. In both cases, the
getoptions proc calls
error [cmdline::usage $optlist $usage]

I would suggest the attached patch which:
1. changes [error] to [return -code -1] if the user
wants help, to differentiate from a real error
2. changes the error string if a real error
occurred.

Discussion

  • Glenn Jackman

    Glenn Jackman - 2001-10-17

    context diff file

     
  • Andreas Kupries

    Andreas Kupries - 2001-10-31

    Logged In: YES
    user_id=75003

    This changes the public interface, hence an update of the
    major version number for this package and tcllib is in
    order. Marking this item with

    MAJOR_VERSION_UPDATE

    to find it and others of thre same kind in a search.

     
  • Andreas Kupries

    Andreas Kupries - 2001-12-11
    • assigned_to: nobody --> andreas_kupries