Feature, implement :main command

Ross Paterson ross at soi.city.ac.uk
Sun Oct 30 08:13:47 EST 2005


On Sun, Oct 30, 2005 at 12:40:47PM +0000, Neil Mitchell wrote:
> Attached is a patch that adds a :main command to hugs. :main arguments
> is equivalent to arguments `withArgs` main, but easier to use because
> you don't need to import anything extra, and the arguments are parsed
> as if they were arguments - i.e. :main my test "of this", instead of
> ["my","test","of this"] `withArgs` main.

Well the Main module probably imports System.Environment anyway, but
I guess this is harmless, and presumably this will be used by some
WinHugs thing.

The usual way to parse arguments to Hugs commands is readFilename(),
which also allows backslashed quotes.  Using this would aid consistency,
but you'll need to work around the fact that it returns a string in
static storage.



More information about the Cvs-hugs mailing list