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

true/false: ignore options #693

Merged
merged 2 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
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
58 changes: 6 additions & 52 deletions bin/false
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,7 @@ License: perl

=cut


use strict;

my ($VERSION) = '1.3';

my $STATUS = 1;

if (@ARGV) {
if ($ARGV [0] eq '--version') {
$0 =~ s{.*/}{};
print "$0 (Perl bin utils) $VERSION\n";
exit;
}
if ($ARGV [0] eq '--help') {
$0 =~ s{.*/}{};
my $success = $STATUS ? "failure" : "success";
print <<EOF;
Usage: $0 [OPTION]

Exit with a $success status.

Options:
--version: Print version number, then exit.
--help: Print usage, then exit.
EOF
exit;
}
}

exit $STATUS;
exit 1;

__END__

Expand All @@ -52,40 +23,23 @@ false - Exit unsuccesfully

=head1 SYNOPSIS

(true | false) [OPTION]
false

=head1 DESCRIPTION

I<true> exits succesfully. I<false> exits unsuccesfully.

=head2 OPTIONS

I<true> and I<false> accept the following options:

=over 4

=item --help

Print out a short help message, then exit.

=item --version

Print out its version number, then exit.

=back
I<false> exits unsuccesfully.

=head1 ENVIRONMENT

The working of I<true> and I<false> are not influenced by any
environment variables.
The working of I<false> is not influenced by any environment variables.

=head1 BUGS

I<true> and I<false> have no known bugs.
I<false> has no known bugs.

=head1 AUTHOR

The Perl implementation of I<true> and I<false>
The Perl implementation of I<false>
was written by Abigail, I<perlpowertools@abigail.be>.

=head1 COPYRIGHT and LICENSE
Expand Down
58 changes: 6 additions & 52 deletions bin/true
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,7 @@ License: perl

=cut


use strict;

my ($VERSION) = '1.3';

my $STATUS = 0;

if (@ARGV) {
if ($ARGV [0] eq '--version') {
$0 =~ s{.*/}{};
print "$0 (Perl bin utils) $VERSION\n";
exit;
}
if ($ARGV [0] eq '--help') {
$0 =~ s{.*/}{};
my $success = $STATUS ? "failure" : "success";
print <<EOF;
Usage: $0 [OPTION]

Exit with a $success status.

Options:
--version: Print version number, then exit.
--help: Print usage, then exit.
EOF
exit;
}
}

exit $STATUS;
exit 0;

__END__

Expand All @@ -52,40 +23,23 @@ true - Exit succesfully

=head1 SYNOPSIS

(true | false) [OPTION]
true

=head1 DESCRIPTION

I<true> exits succesfully. I<false> exits unsuccesfully.

=head2 OPTIONS

I<true> and I<false> accept the following options:

=over 4

=item --help

Print out a short help message, then exit.

=item --version

Print out its version number, then exit.

=back
I<true> exits succesfully.

=head1 ENVIRONMENT

The working of I<true> and I<false> are not influenced by any
environment variables.
The working of I<true> is not influenced by any environment variables.

=head1 BUGS

I<true> and I<false> have no known bugs.
I<true> has no known bugs.

=head1 AUTHOR

The Perl implementation of I<true> and I<false>
The Perl implementation of I<true>
was written by Abigail, I<perlpowertools@abigail.be>.

=head1 COPYRIGHT and LICENSE
Expand Down
Loading