Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Created April 24, 2017 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dogbert17/f97842d671848b75f01a0995b0409155 to your computer and use it in GitHub Desktop.
Save dogbert17/f97842d671848b75f01a0995b0409155 to your computer and use it in GitHub Desktop.
nqp
+ method usage($name?, :$use-stderr = False) {
+ my $print-func := $use-stderr ?? &note !! &say; # RT #130760
if $name {
- say($name);
+ $print-func($name);
}
my $usage := "This compiler is based on HLL::Compiler.\n\nOptions:\n";
for @!cmdoptions {
$usage := $usage ~ " $_\n";
}
- nqp::say($usage);
+ $print-func($usage);
nqp::exit(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment