aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-04-09 15:59:15 -0400
committerB. Watson <urchlay@slackware.uk>2024-04-09 15:59:15 -0400
commitc423da391b9e85f0f75063b73f93330dfffa2e11 (patch)
tree0d14144fb204f526f97f4cfdc5c07bbbb68c5d2d
parent8b52215d6dba5eb97712d872520f2bccc34aa630 (diff)
downloadmisc-scripts-c423da391b9e85f0f75063b73f93330dfffa2e11.tar.gz
soxdial: fix --output option, tighten up option processing in general.
-rwxr-xr-xsoxdial16
1 files changed, 8 insertions, 8 deletions
diff --git a/soxdial b/soxdial
index d1e58f1..b5837ea 100755
--- a/soxdial
+++ b/soxdial
@@ -458,15 +458,15 @@ if(!@ARGV) {
# preprocess @ARGV, convert e.g. -b16 to -b 16, --foo=bar to --foo bar.
@newargv = ();
for(@ARGV) {
- if(/^(--?\w+)=(\S+)$/) {
+ if(/^(--?\w+)=(.+)$/) {
push @newargv, $1, $2;
- } elsif(/^(--?[blcdts])(\d+(?:ms)?)/i) {
+ } elsif(/^(--?[blcdts])([\d.]+(?:ms)?)$/i) {
push @newargv, $1, $2;
- } elsif(/^(--?[r])(\d+(?:k)?)/i) {
+ } elsif(/^(--?[r])(\d+(?:k)?)$/i) {
push @newargv, $1, $2;
- } elsif(/^(--?[D])(\w\w)/i) {
+ } elsif(/^(--?[D])(\w\w)$/i) {
push @newargv, $1, $2;
- } elsif(/^(--?o)(\S+)/) {
+ } elsif(/^(--?o)(.+)$/) {
if($2 eq 'utput') {
push @newargv, $_;
} else {
@@ -492,12 +492,12 @@ for ($argc = 0; $argc < @ARGV; $argc++) {
} elsif(/^--?(?:\?|h)/) {
exec "perldoc $0";
exit 1;
- } elsif(/^--?v(erbose)?$/) {
+ } elsif(/^--?v(?:erbose)?$/) {
$verbose = 1;
- } elsif(/^--?n(oexec)?$/) {
+ } elsif(/^--?n(?:oexec)?$/) {
$verbose = 1;
$noexec = 1;
- } elsif(/^--?o(?:output)?$/) {
+ } elsif(/^--?o(?:utput)?$/) {
$output = $ARGV[++$argc];
die "$SELF: missing argument for --output.\n" unless defined $output;
warn "$SELF: output set to '$output'\n" if $verbose;