Skip to content

Commit

Permalink
GitHub andk#131 - CPAN_OPTS ends upon the wrong side of the args
Browse files Browse the repository at this point in the history
Co-authored-by: chirvasitua <[email protected]>
  • Loading branch information
briandfoy and stuart-little committed Dec 7, 2022
1 parent 9daa374 commit fe99a1e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/App/Cpan.pm
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ to C<1> unless it already has a value (even if that value is false).
=item CPAN_OPTS
As with C<PERL5OPT>, a string of additional C<cpan(1)> options to
add to those you specify on the command line.
add to those you specify on the command line. This string is split
on whitespace and each element added to the front of the argument list.
=item CPANSCRIPT_LOGLEVEL
Expand Down Expand Up @@ -410,7 +411,7 @@ sub _process_options
{
my %options;

push @ARGV, grep $_, split /\s+/, $ENV{CPAN_OPTS} || '';
unshift @ARGV, grep $_, split /\s+/, $ENV{CPAN_OPTS} || '';

# if no arguments, just drop into the shell
if( 0 == @ARGV ) { CPAN::shell(); exit 0 }
Expand Down

0 comments on commit fe99a1e

Please sign in to comment.