Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

env: print usage for bad options #461

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions bin/env
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ while ( @ARGV && $ARGV[0] =~ /^-/ ) {
} elsif ($arg eq '--') {
last;
} else {
warn "$Program: invalid option -- $arg\n";
exit 2;
require Pod::Usage;
Pod::Usage::pod2usage({ -exitval => 2, -verbose => 0 });
}
}

Expand Down Expand Up @@ -87,12 +87,13 @@ I<env> accepts the following options:

=item B<-i>

Clears the environment, passing only the values specifed to the command.
Clears the environment, passing only the values specified to the command.

=item B<-u> I<name>

Clears the environment variable I<name> if it exists.
The value must not include the '=' character.
This option may be repeated.

=back

Expand All @@ -103,7 +104,7 @@ status of the command. Otherwise, I<env> will return one of the following
values:

0 env completed successfully.
1-125 An error occured in env.
1-125 An error occurred in env.
127 There was an error running the command specified.

=head1 BUGS
Expand Down
Loading