[getopt-sig] The bake-off

Greg Ward gward@python.net
Thu, 30 May 2002 09:37:20 -0400


On 30 May 2002, holger@trillke.net said:
> the idea was to make it *even cheaper* to write cmdline-tools
> with a rich interface. The basic idea is to construct a 'namespace'-mapping
> between the shell-cmdline and a python function (or class). I suggested to
> use Optik as the backend for this. I was (and probably still am <wink>) 
> willing to implement this but it is difficult if there is no feedback :-)

But Optik already makes good use of namespaces: when you do this

  (options, args) = parser.parse_args()

then the 'options' object is a namespace containing the user-supplied
values from the command-line.  IOW, you get a namespace on the way out.

There's no namespace on the way in though: options are defined through
explicit, verbose calls to parser.add_option().  I just don't see the
point of your interface.  But by all means, go ahead and implement it on
top of Optik.  If Optik gets in your way and needs refactoring, please
howl -- I'm still (somewhat) willing to entertain proposed code
reorganization.  But that willingness becomes less as time goes on...

        Greg
-- 
Greg Ward - Unix geek                                   gward@python.net
http://starship.python.net/~gward/
"Question authority!"  "Oh yeah?  Says who?"