diff options
author | B. Watson <urchlay@slackware.uk> | 2024-04-09 15:59:15 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-04-09 15:59:15 -0400 |
commit | c423da391b9e85f0f75063b73f93330dfffa2e11 (patch) | |
tree | 0d14144fb204f526f97f4cfdc5c07bbbb68c5d2d /soxdial | |
parent | 8b52215d6dba5eb97712d872520f2bccc34aa630 (diff) | |
download | misc-scripts-c423da391b9e85f0f75063b73f93330dfffa2e11.tar.gz |
soxdial: fix --output option, tighten up option processing in general.
Diffstat (limited to 'soxdial')
-rwxr-xr-x | soxdial | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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; |