App::Prove plugins, options, etc

Andy Armstrong n at rciss.us
Thu Oct 4 20:52:18 BST 2007


On 4 Oct 2007, at 20:32, Eric Wilhelm wrote:
> Perhaps extensions need to register their switches upon installation.

Now they require installation?

The law of least surprises says that programs don't suddenly sprout  
new top level options because something has been installed elsewhere  
on the system. The same law says that if I see a command like

$ prove --verbose

I assume that prove handles the --verbose switch but if you see

$ prove -MSquawk::Baby

you can probably guess that a module is being loaded. And when you  
see that in someone else's script you can probably work out which  
module it needs too. It's somewhat self documenting.

Now somebody gives me a script that does

$ prove --squawk-baby

and my prove says that it doesn't understand --squawk-baby. So I  
assume that I don't have the latest version and spend a few minutes  
upgrading. Still doesn't work. Maybe there's a dev release that does  
--squawk-baby? Etc etc.

How is anyone supposed to know that there's another module hovering  
in the shadows providing baby squawking?

> Maybe we simply disallow short options for plugins (or throw-out all
> conflicting ones.)
>
> We can certainly do better than "anything requiring the user to type a
> colon."

The -M switch is easy to implement, easy to understand and likely to  
be completely familiar to the people who will be using it. And same  
people are presumably sufficiently familiar with their shell that  
they will rarely have to re-type it.

-- 
Andy Armstrong, Hexten





More information about the tapx-dev mailing list