Skip to content

Commit

Permalink
Merge pull request #61 from marcusramberg/improve_help
Browse files Browse the repository at this point in the history
Better help for perl6 binary
  • Loading branch information
moritz committed Apr 21, 2012
2 parents 754e4a0 + 096cf7d commit b1f5835
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/Perl6/Compiler.nqp
Expand Up @@ -41,4 +41,35 @@ class Perl6::Compiler is HLL::Compiler {
}
}
}

method usage($name?) {
say(($name ?? $name !! "") ~ " [switches] [--] [programfile] [arguments]
With no arguments, enters a REPL. With a \"[programfile]\" or the
\"-e\" option, compiles the given program and by default also
executes the compiled code.
-c check syntax only (runs BEGIN and CHECK blocks)
--doc extract documentation and print it as text
-e program one line of program
-h, --help display this help text
-n run program once for each line of input
-p same as -n, but also print \$_ at the end of lines
--target=[stage] specify compilation stage to emit
-t, --trace=[flags] enable trace flags, see 'parrot --help-debug'
--encoding=[mode] specify string encoding mode
-o, --output=[name] specify name of output file
-v, --version display version information
--stagestats display time spent in the compilation stages
--ll-backtrace display a low level backtrace on errors
Note that only boolean single-letter options may be bundled.
To modify the include path, you can set the PERL6LIB environment variable:
PERL6LIB=\"lib\" perl6 example.pl
For more information, see the perl6(1) man page.\n");
pir::exit__vi(0);
}
}

0 comments on commit b1f5835

Please sign in to comment.