Re: TIP #216: Handling Command-Line Options in Tclsh and Wish
From: Arjen Markus (arjen.markus_at_wldelft.nl)
Date: 09/02/04
- Next message: Donal K. Fellows: "Re: [incr] and counting occurrences"
- Previous message: Jeff Hobbs: "Re: tftp client"
- In reply to: Schelte Bron: "Re: TIP #216: Handling Command-Line Options in Tclsh and Wish"
- Next in thread: Schelte Bron: "Re: TIP #216: Handling Command-Line Options in Tclsh and Wish"
- Reply: Schelte Bron: "Re: TIP #216: Handling Command-Line Options in Tclsh and Wish"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 02 Sep 2004 09:14:24 +0200
Schelte Bron wrote:
>
> >
> > * this continues until an argument is found that does not qualify
> > as an option.
> >
> I have this existing script that can take some command line arguments like
> -interface. If someone using my script happens to have an "interface"
> package installed then that package will be loaded and my script doesn't
> get to see the option at all anymore? I don't think I'm in favour of such a
> "feature" to put it mildly.
>
> In the past I've ran into problems with the command line options that wish
> hijacked before my script could get to them. Since 8.4 that problem has
> been solved by running tclsh (which until now doesn't mess with the command
> line) and later load Tk with "package require". Now you want to introduce a
> similar problem again?
>
> With this TIP in place it will be necessary to tell users of scripts not
> only which extensions are needed, but also which extensions are forbidden.
>
> I'm definitely not a supporter of this proposal. Unless of course I
> completely misunderstood how it is supposed to work.
>
My intention was and is to allow some early processing of options. For
instance:
tclsh -debug myapp.tcl -verbose 1 2 3
The -debug option comes _before_ an argument that does not qualify as an
option
(it does not start with "-"), so in my proposal, -debug would be
consumed so as
to load the package "debug" and the result would be as if:
- myapp.tcl did a "package require debug" first
- tclsh was called like this:
tclsh myapp.tcl -verbose 1 2 3
On the TCT mailing list quite a few comments were made about this
proposal,
there are serious issues with this, I quite agree, and I am trying (at
least
mentally) to come up with a more satisfactory formulation, but the idea
first and foremost is _not_ to hijack the argument list but to add a
potentially
useful mechanism that can not be used now anyway - just try to run a
script
called "-myapp.tcl" (note the "-" sign).
Regards,
Arjen
- Next message: Donal K. Fellows: "Re: [incr] and counting occurrences"
- Previous message: Jeff Hobbs: "Re: tftp client"
- In reply to: Schelte Bron: "Re: TIP #216: Handling Command-Line Options in Tclsh and Wish"
- Next in thread: Schelte Bron: "Re: TIP #216: Handling Command-Line Options in Tclsh and Wish"
- Reply: Schelte Bron: "Re: TIP #216: Handling Command-Line Options in Tclsh and Wish"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|