Skip to content

Commit

Permalink
env: '--' is valid option terminator
Browse files Browse the repository at this point in the history
* Test case repeated for GNU and OpenBSD env

%env -i -- O=o printenv
O=o

* This code doesn't use getopt so add '--' manually for now
* Remove ENVIRONMENT section of the manual which is full of vermin lies
  • Loading branch information
mknos authored Dec 15, 2023
1 parent 57b952b commit c096270
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions bin/env
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ while ( @ARGV && $ARGV[0] =~ /^-/ ) {
exit 2;
}
delete $ENV{$val};
} elsif ($arg eq '--') {
last;
} else {
warn "$Program: invalid option -- $arg\n";
exit 2;
Expand Down Expand Up @@ -94,10 +96,6 @@ The value must not include the '=' character.
=back
=head1 ENVIRONMENT
The working of I<env> is not influenced by any environment variables.
=head1 DIAGNOSTICS
If the command is invoked, the exit status of I<env> will be the exit
Expand Down

0 comments on commit c096270

Please sign in to comment.