my last entry (http://use.perl.org/~particle/journal/35300) described how i added support to the Parrot Compiler Toolkit to support a '--help' command line option for compilers. my next commit enables this option for perl6.
view the patch here: http://perlsix.org/svn/parrot/revision/?rev=24554
since i laid the foundation for implementing usage messages in PCT, it was easy to customize it for perl6. i'll walk through it briefly.
the first difference is in the 'onload' subroutine, which is run when the perl6 bytecode is loaded by parrot. after a new HLLCompiler object has been created, i create a new String PMC using a parrot heredoc containing the help text for the command line options specific to perl6. since @larry hasn't written S19, the synopsis on the perl 6 command line interface, these options are likely to change.
the second difference implements the 'usage' method that HLLCompiler calls when the '-h' or '--help' option is passed. if an argument is not passed for the optional parameter 'name', it is defaulted to 'perl6'. a usage message is printed containing the contents of 'name' and the '$usage' attribute of the HLLCompiler object as set above, and the program exits.
based on the techniques i've used to implement '--help', it should be straightforward to implement similar command line options for the perl6 compiler.
perl 6 synopses: