Re: TIP #216: Handling Command-Line Options in Tclsh and Wish

From: Arjen Markus (arjen.markus_at_wldelft.nl)
Date: 09/02/04


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



Relevant Pages

  • Re: FreeWrap using libraries
    ... Wrap the script with the following command. ... The ZIPOBJDIR variable defined in the freeWrap Make files needs to be set to ... To use "package require" you would need to create a pkgIndex.tcl file, ...
    (comp.lang.tcl)
  • Re: Cant get jabber to start on installation
    ... > I have managed to get jabber installed, and running it from the command ... > specifically) trying to run it from the init.d script is another matter. ... fail to start again because the PID file exists. ... Debian package works around this by checking for a stale PID file (and ...
    (Debian-User)
  • RE: Failed software distribution
    ... Did you bundle the cscript.exe file with your package? ... Command line: scanallstate.vbs ... I've created a package and program that should run a VB script to ... client would received the notification ...
    (microsoft.public.sms.admin)
  • Installation of software, and security. . .
    ... installation in Windows and various package managers. ... A setup.exe program coded by some third party such as Real Networks ... A .msi Microsoft Installer package is unpacked, and a script coded by ...
    (Bugtraq)
  • Re: goto &Package::func destroying @_?!
    ... >>script, but maybe the description will trigger something from someone.... ... code the 'Core' package uses another package as a base that has a custom ... package Foo; ... if it really is a problem with goto&. ...
    (comp.lang.perl.misc)