diff options
author | B. Watson <urchlay@slackware.uk> | 2024-04-12 13:10:17 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-04-12 13:10:17 -0400 |
commit | 31565fda69ac7f1628b05b8c906095a18336d2cb (patch) | |
tree | e10b896f8d9d5677c0db5d029b51aa09d1ad20a1 | |
parent | c2a1796507e20b6bcdb5f5a86d5bfd9bf0757303 (diff) | |
download | soxdial-31565fda69ac7f1628b05b8c906095a18336d2cb.tar.gz |
soxdial: allow --help --man --version to work even if sox is missing.
-rwxr-xr-x | soxdial | 24 |
1 files changed, 14 insertions, 10 deletions
@@ -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; |