Tk Library Source Code

View Ticket
Login
Ticket UUID: 540313
Title: Add [getKnownOpt{ions}]
Type: Patch Version: None
Submitter: dgp Created on: 2002-04-06 20:21:21
Subsystem: cmdline Assigned To: andreas_kupries
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2002-04-26 06:31:19
Resolution: Accepted Closed By: andreas_kupries
    Closed on: 2002-04-25 23:31:19
Description:
>From "Melissa Chawla" <[email protected]>
I've added 2 new procedures to the tcllib/cmdline package:

The getKnownOpt and getKnownOptions procedures offer a
way for options 
that
are not in the optionList to be ignored.  This way, you
can have two
independant locations in your application where
commandline arguments 
are
parsed.  I bumped the package version to 1.2.  If I
pass the args "-foo 
x -bar
a b c -debug 1, where -bar is not in the options list,
then "-bar a b c" 
will
remain in argv without causing a problem.

The reason I need this feature is that when I start
TclHttpd, it checks 
the
commandline options and throws an error if there are
options that it 
doesn't
know about.  But I've deliberately added options that
my customized web 
server
libraries will look at, and until now, I had no "nice"
way to pass those
options through the TclHttpd option check to my
application.

My patch includes tests as well as improved
documentation (in the code)
throughout the package.
User Comments: andreas_kupries added on 2002-04-26 06:31:19:
Logged In: YES 
user_id=75003

Committed to head.

andreas_kupries added on 2002-04-25 05:23:57:
Logged In: YES 
user_id=75003

Note that the patch as provided here is malformed. Manual 
application is performed.

dgp added on 2002-04-07 03:21:21:

File Added - 20678: patch

Attachments: