aboutsummaryrefslogtreecommitdiff
path: root/soxdial
diff options
context:
space:
mode:
Diffstat (limited to 'soxdial')
-rwxr-xr-xsoxdial38
1 files changed, 30 insertions, 8 deletions
diff --git a/soxdial b/soxdial
index 357da0b..d1e58f1 100755
--- a/soxdial
+++ b/soxdial
@@ -40,11 +40,11 @@ option.
=head1 OPTIONS
-Note that option bundling is not supported. Use e.g. B<-v -n>, not B<-vn>. Also,
-spaces are required between options and their arguments. Use e.g. B<-b 16>,
-not B<-b16>.
-
-Also, GNU style --option=value is not supported (use B<--bits 16>, not B<--bits=16>).
+Note that option bundling is not supported. Use e.g. B<-v -n>,
+not B<-vn>. Spaces are allowed but not required between options and
+their arguments: B<-b16> and B<-b 16> are equivalent. Also, GNU-style
+B<--option=value> is supported (and works the same as B<--option
+value>).
=head2 Global Options
@@ -455,13 +455,35 @@ if(!@ARGV) {
exit 1;
}
+# preprocess @ARGV, convert e.g. -b16 to -b 16, --foo=bar to --foo bar.
+@newargv = ();
+for(@ARGV) {
+ if(/^(--?\w+)=(\S+)$/) {
+ push @newargv, $1, $2;
+ } elsif(/^(--?[blcdts])(\d+(?:ms)?)/i) {
+ push @newargv, $1, $2;
+ } elsif(/^(--?[r])(\d+(?:k)?)/i) {
+ push @newargv, $1, $2;
+ } elsif(/^(--?[D])(\w\w)/i) {
+ push @newargv, $1, $2;
+ } elsif(/^(--?o)(\S+)/) {
+ if($2 eq 'utput') {
+ push @newargv, $_;
+ } else {
+ push @newargv, $1, $2;
+ }
+ } else {
+ push @newargv, $_;
+ }
+}
+
+@ARGV = @newargv;
+
# this is a big ugly mess. should be refactored. works, though.
for ($argc = 0; $argc < @ARGV; $argc++) {
$_ = $ARGV[$argc];
- if(/=/) {
- die "$SELF: GNU-style --option=value not supported, use --option value.\n";
- } elsif(/--?(?:V|version)$/) {
+ if(/--?(?:V|version)$/) {
print "$SELF $VERSION\n";
exit 0;
} elsif(/^--?man$/) {