Tips on module selection for shell and/or commandline 'subcommand' behavior



Hi,

I will develop a commandline tool and am looking for tips on if there
are modules I should be using rather than (re)write my own.

Basically, the tool should behave like a lot of existing tools - the
actual command (accepting a number of generic flags) and a 'subcommand'
(also accepting flags, but specific for the subcommand).

Thus, very much similar to, say CVS ('cvs checkout') or perforce ('p4
client') etc. The programming model would be eased if the subcommands
followed some sort of plugin pattern. Also, I'd like to have a fair
influence on the treatment on flags given to the 'base' command.

Actually, I have a fairly extensive thing for this already - but if
there's a better module I could reuse, so much the better, I guess.
But, going further, something I don't have is that it would also be
nice if a module would support a shell like behavior (an example of
this combination is the 'cleartool' tool used in ClearCase).

Thus, assuming my tool is 'mytool', and I have written a subcommand
'mysubcommand' one way to invoke it should be:

mytool mysubcommand

But I should also be able to do this:

C:\tmp>mytool
mytool>mysubcommand
mytool>exit
C:\tmp>

It should work equally well on Windows or Linux/Unix though.

Any suggestions on in what corner on CPAN I should look?

TIA,

ken1

.



Relevant Pages