From 099cbdb0dc796286e759d7930387595b7d6700a7 Mon Sep 17 00:00:00 2001 From: Michael Mikonos <127171689+mknos@users.noreply.github.com> Date: Thu, 14 Mar 2024 16:14:18 +0800 Subject: [PATCH] printenv: retire -? flag (#503) * Remove -? which is not present in GNU or BSD version of printenv * The BSD version does not support options starting with a dash * While here, restructure code to avoid multiple exits; exit code 1 is designated for the (optional) argument not being found in environment --- bin/printenv | 45 +++++++++++++-------------------------------- 1 file changed, 13 insertions(+), 32 deletions(-) diff --git a/bin/printenv b/bin/printenv index 1f9eb8d0..81664664 100755 --- a/bin/printenv +++ b/bin/printenv @@ -14,29 +14,22 @@ License: perl use strict; -my ($VERSION) = '1.2'; - -if (@ARGV) { - if ($ARGV[0] eq '-?') { - $0 =~ s{.*/}{}; - print < accepts the following options: - -=over 4 - -=item -? - -Print out a short help message, then exit. - -=back - =head1 BUGS I has no known bugs.