Skip to content

Commit

Permalink
Point to GENERATE-USAGE instead of USAGE
Browse files Browse the repository at this point in the history
USAGE is going to be deprecated.  Also unplan to deprecate $*USAGE for
now, although I still think we should have a better way.
  • Loading branch information
lizmat committed Oct 12, 2018
1 parent 341190e commit 24413b5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/core/Main.pm6
Expand Up @@ -15,16 +15,15 @@ my sub RUN-MAIN(&main, $mainline, :$in-as-argsfiles) {
my &args-to-capture := $provided-a-to-c // &default-args-to-capture;
my %sub-main-opts := %*SUB-MAIN-OPTS // {};

# Set up proxy for old-style usage
# Set up proxy for default generated usage
my $usage-produced;
my $*USAGE := Proxy.new(
FETCH => -> | {
# DEPRECATED MESSAGE HERE
$usage-produced //= default-generate-usage(\())
},
STORE => -> | {
die 'Cannot assign to $*USAGE. Please use `sub USAGE {}` to '
~ 'output custom usage message'
die 'Cannot assign to $*USAGE. Please create a '
~ '`sub GENERATE-USAGE {}` to generate custom usage message'
}
);

Expand Down

0 comments on commit 24413b5

Please sign in to comment.