From 31565fda69ac7f1628b05b8c906095a18336d2cb Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 12 Apr 2024 13:10:17 -0400 Subject: soxdial: allow --help --man --version to work even if sox is missing. --- soxdial | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/soxdial b/soxdial index a836fb8..fae3dda 100755 --- a/soxdial +++ b/soxdial @@ -550,6 +550,19 @@ sub check_stereo { } # main() +for(@ARGV) { + if(/--?(?:V|version)$/) { + print "$SELF $VERSION\n"; + exit 0; + } elsif(/^--?man$/) { + exec "pod2man --stderr -s6 -cUrchlaysStuff -r$VERSION -u $0"; + exit 1; + } elsif(/^--?(?:\?|h)/) { + exec "perldoc $0"; + exit 1; + } +} + if(system("sox --version > /dev/null 2>&1") != 0) { die "$SELF: can't execute sox, is it installed?\n"; } @@ -589,16 +602,7 @@ for(@ARGV) { for ($argc = 0; $argc < @ARGV; $argc++) { $_ = $ARGV[$argc]; - if(/--?(?:V|version)$/) { - print "$SELF $VERSION\n"; - exit 0; - } elsif(/^--?man$/) { - exec "pod2man --stderr -s6 -cUrchlaysStuff -r$VERSION -u $0"; - exit 1; - } elsif(/^--?(?:\?|h)/) { - exec "perldoc $0"; - exit 1; - } elsif(/^--?v(?:erbose)?$/) { + if(/^--?v(?:erbose)?$/) { $verbose = 1; } elsif(/^--?n(?:oexec)?$/) { $verbose = 1; -- cgit v1.2.3