[svn:parrot] r48661 - trunk/tools/dev

plobsing at svn.parrot.org plobsing at svn.parrot.org
Thu Aug 26 01:31:20 UTC 2010


Author: plobsing
Date: Thu Aug 26 01:31:20 2010
New Revision: 48661
URL: https://trac.parrot.org/parrot/changeset/48661

Log:
add --help option to pbc_to_exe

Modified:
   trunk/tools/dev/pbc_to_exe.pir

Modified: trunk/tools/dev/pbc_to_exe.pir
==============================================================================
--- trunk/tools/dev/pbc_to_exe.pir	Thu Aug 26 01:21:22 2010	(r48660)
+++ trunk/tools/dev/pbc_to_exe.pir	Thu Aug 26 01:31:20 2010	(r48661)
@@ -18,8 +18,6 @@
   pbc_to_exe my.pbc --install
   => installable_my.exe
 
-Warning! With --install there must be no directory prefix in the first arg yet.
-
 =cut
 
 .include 'interpcores.pasm'
@@ -158,20 +156,37 @@
     push getopt, 'install|i'
     push getopt, 'runcore|R:s'
     push getopt, 'output|o:s'
+    push getopt, 'help|h'
 
     $P0 = shift argv # ignore program name
     .local pmc opts
     opts = getopt.'get_options'(argv)
-    .local string infile
-    infile = shift argv
 
+    .local int    help
     .local int    install
     .local string runcore
     .local string outfile
+    help    = opts['help']
     install = opts['install']
     runcore = opts['runcore']
     outfile = opts['output']
 
+    unless help goto end_help
+        $P0 = getstderr
+        print $P0, <<'HELP'
+pbc_to_exe [options] <file>
+  Options:
+    -h --help
+    -i --install
+    -R --runcore=slow|fast
+    -o --output=FILE
+HELP
+        exit 0
+    end_help:
+
+    .local string infile
+    infile = shift argv
+
     $S0 = substr infile, -4, 4
     $S0 = downcase $S0
     unless $S0 != '.pbc' goto done_pbc_extn_check


More information about the parrot-commits mailing list