Passing "dash" Options to a procedure
- From: "Sam" <perlquestions@xxxxxxxx>
- Date: Thu, 20 Oct 2005 15:02:14 -0400
I've been looking for a way to write my TCL procedures to accept "dash"
options, but I haven't had any luck.
As an example, I'm trying to take something like this:
sub my_proc { {var1 "foo"} {var2 "bar"}} {
puts $var1
puts $var2
}
which does:
>my_proc
foo
bar
>my_proc cat
cat
bar
and turn it's interface into this
>my_proc -var2 dog
foo
dog
>
So now it will still have it's defaults, but I can override var2 without
having to specify var1.
Does anyone have any ideas how to do this? I'm sure it's been solved before.
If so, does anyone know of a package that's out there that can handle this
type of option passing?
.
- Follow-Ups:
- Re: Passing "dash" Options to a procedure
- From: davidhbigelow
- Re: Passing "dash" Options to a procedure
- From: GN
- Re: Passing "dash" Options to a procedure
- From: Larry Smith
- Re: Passing "dash" Options to a procedure
- From: Juan C. Gil
- Re: Passing "dash" Options to a procedure
- From: Bryan Oakley
- Re: Passing "dash" Options to a procedure
- From: davidhbigelow
- Re: Passing "dash" Options to a procedure
- Prev by Date: Re: Problems with creating images from pdf...
- Next by Date: Re: Having trouble with WM_DELETE_WINDOW protocol in tcl 8.3
- Previous by thread: Problems with creating images from pdf...
- Next by thread: Re: Passing "dash" Options to a procedure
- Index(es):
Relevant Pages
|